httpwebrequest

Help threading HttpWebRquest in c#

Hi guys just wondering if somebody could help me try and correctly thread my application, I am constantly hitting an hurdle after another, I have never been to clued up on threading in applications. I have tryed following this http://www.developerfusion.com/code/4654/asynchronous-httpwebrequest/ tutorial. basically I'm just trying to st...

C# using Tor as Proxy

Hi, I am trying to use Tor-Server as a proxy in HttpWebRequest, my code looks like this: HttpWebRequest request; HttpWebResponse response; request = (HttpWebRequest)WebRequest.Create("http://www.google.com"); request.Proxy = new WebProxy("127.0.0.1:9051"); response = (HttpWebResponse)request.GetResponse(); response.Close(); it work...

Understanding Asynchronous HttpWebRequest

I'm trying to figure out how this works exactly. HttpWebRequest has a method BeginGetResponse which accepts as a parameter a ResponseCallback. Firstly, is this callback called immediately (in a new thread) or once it receives a response back from the server? Or is it the job of EndGetResponse to wait for the response? Secondly, once yo...

How to Clone HttpWebRequest?

I want to set some properties of an HttpWebRequest and then download some files asynchronously. However, I need one copy of HttpWebRequest for each download, so how can I clone it so that I don't have to copy each property "by hand"? ...

C#: "Using" Statements with HttpWebRequests/HttpWebResponses

Jon Skeet made a comment (via Twitter) on my SOApiDotNet code (a .NET library for the pre-alpha Stack Overflow API): @maximz2005 One thing I've noticed just from browsing the source quickly: you don't disposed (sic) of WebResponses. "using" statements FTW. He indicates that I need to wrap these Web sessions in "using" stateme...

Need help with HttpWebRequest on a Compact Framework Project

Hi, not so long ago I´ve created a small iphone app for my Daily use. Now I want to port this app to a Windows Mobile Device while using C# and the Compact Framework. But I really have no clue how to use the HttpWebRequest and the msdn doesn´t help me either. I think I have a lag of understanding on how Web Requests work in general. In...

.Net CF / HttpWebRequest and a "WebException was unhandled"

Hello, I´m trying to use a Webservice in a .Net Compact Framework 3.5 Project which has no WSDL and where I have to use HttpWebRequest. I´ve tried my code on 2 Devices and on the Emulator but I get everytime the same Exception and I really don´t get why!? First, my code: internal void SendSms() { HttpWebRequest req = (Http...

Managing cookies in a WPF WebBrowser control?

Is there a way to read/write the cookies that a WebBrowser control uses? I am doing something like this... string resultHtml; HttpWebRequest request = CreateMyHttpWebRequest(); // fills http headers and stuff HttpWebResponse response = (HttpWebResponse)request.GetResponse(); using (StreamReader sr = new StreamReader(response.GetRes...

Recommendations for executing .NET HttpWebRequests in parallel in ASP.NET.

I have an ASP.NET MVC web application that makes REST style web service calls to other servers. I have a scenario where I am making two HttpWebRequest calls to two separate services. I need them both to complete to continue, but their order doesn't matter. They may take 1-2 seconds each and I am running them in sequence now. Running ...

Browser tool to calculate & set authorization headers?

Are there any Firefox add-ons/extensions that would create the correct necessary values for Authorization HTTP Header, given a username/password dataset? I have some code that's calculating the value for the Authorization header but the server is rejecting it. I'm looking to compare value that I've created against what a browser would i...

Parsing dependent requests in an http web response

Hi, I want to simulate the behaviour of the WebTestRequest class (in Visual Studio's Test Tools framework) where it can invoke dependent requests based on resources that are referred to in the response that is obtained from the original request. For example, if I issue a web request and get the response by doing this: string url = "ht...

What are valid values for the MediaType Property on a HttpWebRequest

What are valid values for the MediaType Property on a HttpWebRequest? I want to do something like this: Dim url As String = HttpContext.Current.Request.Url.AbsoluteUri Dim req As System.Net.HttpWebRequest = DirectCast(System.Net.WebRequest.Create(New Uri(url)), System.Net.HttpWebRequest) ' Add the current authentication cookie to the r...

How to Enable Javascript When Making an HttpWebRequest

I need to call a web page that has javascript. At the bottom of the page I have the following: <noscript> <p>Javascript is not supported or enabled.</p> </noscript> When I make my HttpWebRequest request like so, it is clear that the javascript on the page did not execute. Dim req As System.Net.HttpWebRequest = DirectCast(Syst...

Intercepting the end of the HTTP Session with Seam

I need to intercept the end of each request a user does against a Seam web app. While Filters seem to be the right tool for catching requests before they hit your business logic, Interceptors seem to be useful as advices for individual classes... Thanks! ...

Attaching jsondata to the call of loading a jsonstore in Extjs via POST request

Hi, is there a way to attach jsondata to a POST request for loading a store? I know it's possible through a GET request by simply adding params : {data1 : 1, data2 : 2} on the load call, but I've had no success attaching jsondata. I've tried the following and a few variations of it and no luck. I'm using Extjs 2.2 w/ Alfresco //creat...

HTTPWebRequest, SSL end point validation and

Hi, I'm writing an client application that has to query a URL and confirm the user is authorized to be used the client. Think of it as a very rudimentary licensing mechanism. The page on the server writes out a plain text string including some information about the user which serves as the validation. All this is done over SSL. However...

C# HTTP web request keeps timing out

I am making a Http Webrequest to an available site that I can visit fine, but the HTTP Web request keeps timing out. Is there any reason why this code might allow it to timeout when it shouldn't? I've tried upping the timeout setting, but it still continues to timeout. Uri CameraUrl = new Uri("http://" + cfg_cameraIps[i]); Http...

c# smartdevice - HTTPWEBREQUEST GET vs POST InvalidOperationException

In the code below, DoGet is working very stable. But DoPost throws an uncatcheable InvalidOperationException randomly. I am lost. Any pointers will be of immense help. /* Environment ------------- * NET CF 2.0 * WM 5.0(USA Mobile Pocket PC Emulator) * Windows XP Professional SP2 * VS 2008 */ /* The exception...

Dynamic datagrid Httpservice

I receive from the httpservice with a certain frequency a string like this: 1#3#234525234 where row#column#value I want to display into datagrid the above string at real time; at the moment my code displays the whole string, composed by many strings like the one above. How can i solve the problem? Thanks in advance I have the following ...

Jquery ajax request, wait for latest request to finish

I have a textbox that for each time a user inputs a letter I make a search with an ajax request and show the result "live" for the user. Often when a user types the letters it takes longer time for the request to be made than for the user to input a new letter, hence a new request is made before the first one have ended. It would be much...