httpwebrequest

HttpWebRequest POST gives 500 server error

I need to make from my app an authentificated httpwebrequest. the response to my request should be in json format. for this i'm using the code below: // Create the web request Uri address = new Uri("http://www.mysite.com/remote/user/login/format/json"); HttpWebRequest request = WebRequest.Create(address) as HttpWebReque...

HttpWebRequest: The request was aborted: The request was canceled

I am trying to send up an xml file and get back an xml file as a response. The file I am trying to send up is slightly over 20,000 KB. I tried adding a timeout, and setting keepalive to false, but neither one works. I've searched around but I can't find anything that is applicable to me. As of now I've just broken the file down and have ...

how do i get http header values from a post request.

Hi Guys, See what I'm trynig to do is on a post request made collect the http headers and then add them to app.Request.Headers.Add(). In my application basically another post request overides certain post requests that I make. On each request to my server there is a redirection to another server which adds some headers over my origina...

How do i start and stop application state in ASP.NET

What seems to be happening is on a request some values I have retrieved are being stored in application state, but when I make changes to the values, the old values are still in application state for a while before finally going. I want a way to refresh the application state on each request.? ...

I keep getting "Timed Out" Errors on C# WebRequest

I've created a program that loads data from an HTTP request. It has to load it every 1 sec or 0.25 sec. However I've found that that many of my request - a few every minute - are timed out. It's weird because trying to reload the same address in a web browser, even when reloading very often, I always get the contents quickly. This is t...

unable to connect to remote server when using HttpWebRequest.GetRequestStream

I am creating a simple HTTP client/server application on my local machine but I don't know why the ListenerCallback is triggered on the server; however, EndGetContext is not completing while throwing 'Web Exception: Unable to connect to remove server" on the client side. Any ideas? here's the code class Server { static void Main...

How do I pass username and password to an httpWebRequest in silverlight 4

How do I pass username and password to an HttpWebRequest in Silverlight 4. since the HttpWebRequst class in silverlight does not implement Credentials property, therefore i am unable to authenticate my user. one way I found was, to pass credentials in header using Authorization header, but it requires ASCII encoded value, which is not...

HTTP request with post

Hello. How can I make http request and send some data via post? I can do "get" request but have no idea how to make "post" one. C# ...

Rails : Return a custom HTTP Response

Hi everyone, I'm using a payment module from Paybox. This module is a CGI script that I execute like a shell command with backticks : `#{Rails.root}/public/cgi/modulev3.cgi [params]` This module outputs a complete HTTP response, including headers and body : Content-type: text/html Cache-Control: no-cache, no-store Pragma: no-cache ...

Posting XML data with some Fields Using .net HttpWebRequest..

Hi to all I have a some problem while Posting xml data Using HttpWebRequest. Actually I want to Post 3 Form variables 2 of them are for credential and the third one is for XML data to an api, The api will authenticate and will process the xml data, and will return success if no error found. Here is what there documentation says. The ...

C# HttpWebRequest times out after two server 500 errors

After I make two C# HttpWebRequests that throw an exception because of "(500) Internal Server Error 500", the third attempt throws a time out exception. Why doesn't it throw another (500) Internal Server Error exception? When I restart my application, it throws two 500 errors and then starts timing out again. This is my code: GetPages...

Logging into Microsoft Online website programatically with C#

Hi guys, I'm trying to write a utility which will attempt to login to the Microsoft Online Admin website and report back as to whether it is reachable. Using code mainly from this article, http://odetocode.com/articles/162.aspx and some screen scraping I have pieced together the following. Unfortunately it doesn't work, the final respon...

Detect 404 without catching exceptions

Simple function: Check if a webserver returns a non-200 HTTP status. Private Function RemoteFileOk(ByVal Url As String) As Boolean Dim req As HttpWebRequest = TryCast(WebRequest.Create(Url), HttpWebRequest) req.Method = "HEAD" Dim rsp As HttpWebResponse = TryCast(req.GetResponse(), HttpWebResponse) Return (rsp.StatusCode = Http...

Http request Demo

i want to create a demo to view the http request sent while redirecting to any URL like that of web-sniffer.net how to do that using javascript ...

Timeout with HttpWebResponse in .NET

I have the following code, and after ~60 times calling it (20 concurrent connections) it starts timing out. if i lower the timeout from 10 minutes to 1 minute, they start timing out at ~34 downloads. what gives? i know that you can get this if you don't properly close your response, but i'm definitely closing it: //=================...

HttpWebRequest support for named pipes?

To all the .NET experts, I have a question for you. I need to do SOAP/HTTP over named pipes on Windows, in C#. (This is for a client talking to a Python library/server using SOAP for RPC. Using socket/port was deemed both insecure, and port configuration becomes a hassle.) There are two problems. There is an HttpWebRequest class,...

Wait for HttpWebRequest.BeginGetResponse to finish in Windows Phone 7

I'm trying to use the async HttpWebRequest in Silverlight for Windows Phone. All works perfect until I get to the where I should call private static ManualResetEvent allDone = new ManualResetEvent(false); ... request.BeginGetResponse(new AsyncCallback(GetResponseCallback), request); allDone.WaitOne(); Debug.WriteLine("All done!"); In ...

Glassfish JSF 2.0 charset problem

Hi! I'm working on a project developed with JSF 2.0 (Mojarra 2.0.3) front end and deployed on Glassfish v.3.0.1 server. Application must accept ISO-8859-2 charset and write data to MySql database. To problem is that data is not in right charset. The request Http header has attribute value: content-type: application/x-www-form-urlenco...

HttpWebRequest leads me to System.NotSupportedException.

I am trying to send data on the server using the following code in windows 7 phone based development. public static void sendData() { HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); IAsyncResult token = request.BeginGetResponse(new AsyncCallback(GetStatusesCallBack), request); } public static void GetStatus...

Ctrl+F5 vs Ctrl+R (On Browsers)

is there a difference between these two shortcuts on most browsers? ...