httpwebrequest

how to use http post with proxy support in c#

how to use http post with proxy support in c# and multipart form data upload method ...

Asp.net - Post form data to a seperate URL without creating a new Request

While this is similar to other questions, I've been unable to figure this out, and I feel pretty dumb for not knowing how to do it. 1) I can't use the PostbackURL property for the button click. Basically what I need to do is, when a user clicks a button, I need to post data to a separate URL. That data is not found within the form. I...

How to close underlying connections after catch httpwebrequest timeout

My asp.net application sending httpwebrequest to remote REST server and waiting for the response, and I found there are lots of same error message like this: System.Net.WebException: The operation has timed-out. at System.Net.HttpWebRequest.GetResponse() Is that possible that after I catch this exception and close the underlying http c...

[ASP.NET MVC] Controller constructor called on every request

I'm trying to test a very simple form that uses only a list and a create. This is the controller: public class PositionsController : Controller { private readonly IPositionRepository _positions; // default constructor public PositionsController() { _positions = new TestPositionRepository(); } // DI cons...

ASP.NET HttpWebRequest stop sending requests, high CPU usage

I have an old ASP.NET application. We send out httpWebRequest to a remote REST server and retrieve XML back, most of the time the application works fine. Recently, we got some high CPU usage issue several times a day. During the high CPU usage time, we monitored those httpWebRequest connections (by checking netstat for the w3wp process)...

HttpWebRequest How to handle (premature) closure of underlying TCP connection?

I have a hard time figuring out if there is a way to handle potential connectivity problems when using .NET's HttpWebRequest class to call a remote server (specifically a REST web service). From my investigations the behaviour of the WebClient class is the same, which is somewhat expected since it appears to only offer a more simple inte...

.NET - download a web page with multiple authentication

There is a particular secure web page that we are required to download and parse. Its from this parsed data we need to do a host of other things... The so-called 'multiple authentication' part goes like the follows: If you've hosted web sites on IIS and turned on the Integrated Security feature (with anonymous browsing turned off), you'...

C# Threadpooling HttpWebRequests

I've read and looked a quite a few examples for Threadpooling but I just cant seem to understand it they way I need to. What I have manage to get working is not really what I need. It just runs the function in its own thread. public static void Main() { while (true) { try { Thr...

Long time to load first connection in C# .NET

I'm making a program that connects to a website and downloads XML from it. It then displays the information to the user. The problem I am having is when I first open the program and start downloading the XML information it takes a really long time. When I load another page from the site with the program still open, it takes about half ...

Detecting the http request type (GET, HEAD, etc) from a python cgi

Hi, How can I find out the http request my python cgi received? I need different behaviors for HEAD and GET. Thanks! ...

How to test if web site written in ASP.Net still alive?

Hi I need to write a simple WinForms apps that can be fired to test if a website is still alive and that that website is able to read from a database. I am using the whole "(HttpWebResponse)myHttpWebRequest.GetResponse()" thing in c# to test whether the site is alive, but I am at a lose for how to get a test page in my website to write...

http post with flash ?

when using http post with flash that send ip address request from client computer or server? Useful Link ( i add it because when using Google Search with"http post with flash" its first page ) http://www.shinedraw.com/data-handling/flash-vs-silverlight-simple-http-post-request/ example var sender = new LoadVars(); sender.x = "xx...

Redirect user to authenticated page that uses forms authentication, using HTTP Location Header, HttpWebRequest/Response and Response.Cookies.Add()

I need to autheticate on a site using forms authentication and then redirect the user to that site along with the session cookie. I have not figured out how to successfully do this. Here's my code so far.. I still get redirected to that apps login page. Any help is much appreciated! protected void Button1_Click(object sender, EventA...

Can a PHP script trick the browser into thinking the HTTP request is over?

I first configure my script to run even after the HTTP request is over ignore_user_abort(true); then flush out some text. echo "Thats all folks!"; flush(); Now how can I trick the browser into thinking the HTTP request is over? so I can continue doing my own work without the browser showing "page loading". header(??) // someth...

This stream does not support seek operations. HttpWebResponse

Hi, I'm making a program which downloads files over http. I've got it downloading, however I want to be able to pause the downloads, close the program and resume them again at a later date. I know the location i'm downloading them from supports this. I'm downloading the file through HttpWebResponse and reading the response into a Str...

407 Authentication required - no challenge sent

Update: If you've just arrived at this question, the general gist is that I'm trying to make a HttpWebRequest via a proxy, and I'm getting a 407 from our strange proxy server. IE,Firefox,Chrome all manage to negotiate the proxy sucessfully, as do Adobe Air applications. It may be important that the Google Chrome web installer actually fa...

HttpWebRequest: How to find a postal code at Canada Post through a WebRequest with x-www-form-enclosed?

I'm currently writing some tests so that I may improve my skills with the Internet interaction through Windows Forms. One of those tests is to find a postal code which should be returned by Canada Post website. My default URL setting is set to: http://www.canadapost.ca/cpotools/apps/fpc/personal/findByCity?execution=e4s1 The required f...

How to set custom "Host" header in HttpWebRequest?

How can I set a custom Host header in HttpWebRequest? I know that normally this class doesn't allow you to do so but is there anyway to use reflection or something like that without actually need me to send the whole packet with TCPClient? ...

C# keep session id over httpwebrequest

I need to preserve the same session id when navigating over a site's pages using C#.Net (like a crawler). I found a couple of methods, a http sniffer was very handy, to compare what my IE browser was sending (HTTP request) and receiving from the web server (HTTP response), as the important information is in the headers (that are not disp...

WebRequest: How to find a postal code using a WebRequest against this ContentType="application/xhtml+xml, text/xml, text/html; charset=utf-8"?

I first posted this: HttpWebRequest: How to find a postal code at Canada Post through a WebRequest with x-www-form-enclosed?. Following AnthonyWJones suggestions, I changed my code following his suggestions. On a continuation of my inquiry, I have noticed with time that the content-type of Canada Post is more likely to be "application/...