httpwebrequest

The correct way to retreive data from a HttpWebRespose Stream then add text.

I am trying to retrieve a web page, add some text at the top of the page then I will be sending off the string. Here is a example framework of what I am trying to do. Is this the correct method or am I doing a big no-no somewhere? HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.example.com"); var responce = (HttpW...

HttpWebReqest in page fetcher slow down

I have a crawler that download pages and process them. after 1 hour every request to the sources takes 1 minute or more to complete but in the start of the program every address is downloaded under 1 second, I suspected that destination web sites limit my request or traffic but when i close the program and run it again performance return...

Why might HttpOpenRequest fail with error 122?

The following code fRequestHandle = HttpOpenRequestA( fConnectHandle, "POST", url.c_str(), NULL, NULL, NULL, INTERNET_FLAG_RELOAD|INTERNET_FLAG_NO_CACHE_WRITE, 0); is returning NULL with GetLastError() returning 122. A search suggests th...

Post requests: Correct http header syntax?

Im using TTURLRequest from the cocoa Three20 development library to form a post request. I'm setting the http headers with this: [request setValue:VALUE forHTTPHeaderField:KEY]; I'm getting a 400 response back. I'm also using Charles to capture the requests and responses. The request is getting out (with the headers I had put i...

Is it possible to transfer authentication from Webbrowser to WebRequest

I'm using webbrowser control to login any site. And then i want to download some sub page html using WebRequest (or WebClient). This links must requires authentication. How to transfer Webbrowser authentication information to Webrequest or Webclient? ...

Handling large pac files in C# HTTPWebRequest

I currently have a C# application which makes frequent web requests that have to potentially go through proxy authentication. In this situation, a large PAC file (200kb+) is used to automatically configure the proxy and is stored on a remote server. When initializing the HttpWebRequest I have been setting the default proxy by using 'Web...

Handling HTTP request

If there is a HTTP request coming to a web server from many clients the requests will be handled in the order. For all the http request i want to use a token bucket system. So when there is a first Request i write a number to a file and increment the number for the next request and so on.. I dont want to do it in DB since the DB size i...

How to Specify WebRequest IP to use (or HttpWebRequest if applicable) (C#)

Hi All, Is it possible to specify the IP address a WebRequest should use when creating a connection to a remote resource? For example, I have an MVC 2 website which runs on IP 0.0.0.10, but the server has 0.0.0.1 - 0.0.0.10 assigned to it. In the website there is a class that will be initialized based on user input and it will create re...

Httpwebrequest / Httpwebresponse - Redirect Count

Hi Guys, I'm trying to figure out how many times my web request was redirected before I finally landed at the end content. I'm creating my web request as follows: var httpRequest = (HttpWebRequest) WebRequest.Create("some arb path"); httpRequest.AllowAutoRedirect = followRedirects; I've had a look at the following URL http://msdn.m...

How to process custom certificates in HTTPS?

I am trying to fetch a page using HttpWebRequest, but I am getting this exception: Could not establish trust relationship for the SSL/TLS secure channel. Is it possible to specify a custom RemoteCertificateValidationCallback for a particular instance of HttpWebRequest? (I cannot use ServicePointManager.ServerCertificateValidationCall...

HttpWebRequest & UploadProgressChanged ????

How can I use HttpWebRequest.BeginGetResponse and get progress changed events for the upload of POST method ? A portion of the Code I have now is: HttpWebRequest req = (HttpWebRequest)WebRequestCreator.ClientHttp.Create(uploadUri); req.Method = "POST"; req.ContentType = "multipart/form-data; boundary=" + boundary + ""; req.ContentLe...

How to get method of form using javascript or jquery when we submit a form ?

How to get method of form using javascript or jquery when we submit a form at client ? ...

Check that no variables have been passed

I have one file index.php, I am trying to include splash.php when no variable is passed and display.php when any variable is passed. This is what i have so far but i want to make it universal for all variables instead of just "query". if (!isset($_REQUEST['query'])) { include("splash.php"); } else { include("display.php"); } ...

Unable to retrieve message body on server-side from HTTP Post

I am sending an HTTP post request using HTTPWebRequest to an URL. I am sending the post data using multipart/form-data content type along with the content length of the body. However, on the server side, I am unable to retrieve the body. I can only see the headers sent. The content length of the body I sent also matches. Why am I not ab...

ASIHTTPRequest File Upload image....

I am trying write a simple image uploader using ASIHTTPRequest... but at the code below.... [request setData:imageData withFileName:@"iphone.jpg" andContentType:@"image/jpeg" forKey:@"photo"]; I get below warning msg.... warning: 'ASIHTTPRequest' may not respond to '-setData:withFileName:andContentType:forKey:' not too sure whats ...

Is it possible to download only one part of a file (e.g, the first 100KB) in C#?

I'm just curious about whether this is possible - I know how to download a file, but how can I download only the first 100KB of a file? ...

Accessing REST WebService in VB.NET

I am trying to access a REST webservice, however my code doesn't work and keeps throwing a HTTP 401 error see this example screen cap from Wireshark of the initial ssl request: image link This is from a Curl call to the same web address with the same details. The issue is that under my VB.NET version the "Extension: server_name" (and ...

Why do HTTPWebRequests and the WebBrowser control seem to perform more slowly for me when run from an EXE invoked by a windows service?

So I'm running a Windows Service as a user. Admin rights. This service launches an EXE via Process.Start. Within the EXE, a WebBrowser control is used to navigate to a website, log in, handle all the security handshaking, and get some data. It comes back out, writes the data to a file. Not the most efficient process, admittedly, but...

Copying Http Request InputStream

Hi, I'm implementing a proxy action method that forwards the incoming web request and forwards it to another web page, adding a few headers. The action method works file for GET requests, but I'm still struggling with forwarding the incoming POST request. The problem is that I don't know how to properly write the request body to the o...

receiving X509 client certificates in web requests

I am trying to send an X509Certificate from an Http Handler to a web service that will receive and read the certificate to authenticate the user. I know the certificate is sending fine; I have a tester that lets me look at the HttpWebRequest before sending, and the ClientCertificates property shows that it has a certificate attached. (e...