httpwebrequest

Why PreAuthenticate is not enabled by default?

As far as I understand WebRequest.PreAuthenticate is almost always good. If I enable it even when there is no credential it won't try to authenticate, if there is a credential it'll. So is there any legitimate reason to set it False? Or is it OK to set it True even when there is no credentials? And since it's quite useful why it's no...

Rack URL Mapping

Hi, I am trying to write two kind of Rack routes. Rack allow us to write such routes like so: app = Rack::URLMap.new('/test' => SimpleAdapter.new, '/files' => Rack::File.new('.')) In my case, I would like to handle those routes: "/" or "index" "/*" in order to match any other routes So I had trying this: ...

What happens when a user presses stop in their web browser?

If a page is called that requires a lot of processing and the user clicks stop before the end, does the browser simply stop the request at the client side? Or is a 'stop' message sent to the server, i.e. is the processing cancelled? ...

post data through httpWebRequest

Hello, everybody. I need to "Post" some data to an external website using HttpWebRequest object from my application(desktop) and get a response back into my application through HttpWebResponse object. But the webpage on which i m posting data have textboxes which have dynamic names. how can i get the name of those textboxes and post dat...

GAE HTTP method support

I get an "unrecognized HTTP method" when trying to do a REPORT request using httplib and gae. Is there a workaround available? An httplib patch for gae? Do you I have to find another host in order to do this natively? According to the docs, only certain fetch actions are valid: GET, POST, HEAD, PUT, and DELETE: http://code.google.com/a...

what .NET class to proxy HTTP requests through? (and keep track of bandwidth used)

What .NET class/methods could I use to write a simple HTTP(s) proxy that would run on my PC that would: Proxy all HTTP(S) requests through it Let me get bandwidth used per proxy'ed request (e.g. content length) Let me get requesting application or process name per proxied request Ability to proxy/stream the requests on through to my n...

KeepAliveException when using HttpWebRequest.GetResponse

I am trying to POST an attachment to CouchDB using the HttpWebRequest. However, when I attempt "response = (HttpWebResponse)httpWebRequest.GetResponse();" I receive a WebException with the message "The underlying connection was closed: A connection that was expected to be kept alive was closed by the server." I have found some articles...

Download office document without the web server trying to render it

I'm trying to download an InfoPath template that's hosted on SharePoint. If I hit the url in internet explorer it asks me where to save it and I get the correct file on my disk. If I try to do this programmatically with WebClient or HttpWebRequest then I get HTML back instead. How can I make my request so that the web server returns th...

How to expand URLs in C#?

If I have a URL like http://popurls.com/go/msn.com/l4eba1e6a0ffbd9fc915948434423a7d5, how do I expand it back to the original URL programmatically? Obviously I could use an API like expandurl.com but that will limits me to 100 requests per hour. ...

ASP.net MVC - Check status request

Hi guys Just wondering if its possible to get the status of a request from another request? To help provide some context, I want to use ajax to upload some files to the server. When the upload is started I want triggered another ajax request that checks to see how much of the file has been uploaded (or in other words how big was the o...

Determine how many bytes of a request have been read/received?

Hey guys Just wondering if anyone has any idea how you can determine how many bytes of a request have been read/received by the server... In other words how do I stream http request... In that, users are uploading files and I want to report on a perotic basis how many bytes have been read/received so far. Just wondering if anyone ha...

Posting comments to a wordpress-blog in Android

I am working on a module that allows users to post comments on a blog published on Wordpress. I looked at the HTML source for Post-Comment-Form displayed at the bottom of a blog entry (Leave a Reply section). Using that as a reference, I translated it to Java using DefaultHTTPClient and BasicNameValuePairs and my code looks like: Defaul...

How to save webpage to string with cookies support (httpWebRequest)

I need to read webpage and store its content in string for further processing. Sounds simply but I have problem with cookies support. Opened page says I need browser supporting cookies (or turned on). I've made method trying do that via httpWebRequest - which normally works to me but I've come to a standstill with those unfortunate cook...

loading files through one file to hide locations

Hello all. Im currently doing a project in which my client does not want to location ( ie folder names and locations ) to be displayed. so I have done something like this: <link href="./?0000=css&0001=0001&0002=css" rel="stylesheet" type="text/css" /> <link href="./?0000=css&0001=0002&0002=css" rel="stylesheet" type="text/css" /> <scri...

HttpWebRequest does has empty response requesting a search from Bing

I have the following code that sends a HttpWebRequest to Bing. When I request the url below though it returns what appears to be an empty response when it should be returning a list of results. var response = string.Empty; var httpWebRequest = WebRequest.Create("http://www.bing.com/search?q=stackoverflow&amp;coun...

Can someone help me with simple algo?

I want to parse all bytes downloaded by http request if they are > 100kb, if they are not, to concat them to a buffer and when the buffer gets > 100kb to parse them again and null the uffer. But not to parse all the file data and in the final chunk to get ex: 2kb. It must check the next chunk and if it's final to concat it (ex: final_chu...

.Net C# : Read attachment from HttpWebResponse

Is it possible to read an image attachment from System.Net.HttpWebResponse? I have an url to a java page, which generates images. When i open the url in firefox, the download dialog appears. Content-type is application/png. Seems to work. when i try this in c# and make a GET request i retrieve the content-type: text/html and no conten...

Why does my Windows Form app timeout when repeatedly hitting IIS 7 externally?

hey guys, I've got a very simple Windows Form app that hits an IIS 7 site about 2000 times in the space of a few seconds (using threads). When I run that app on the server itself, using either localhost or the ip address, everything is totally fine. However, when I run the app on my dev box, using the ip address, I get an error from t...

Mysterious socket / HttpWebRequest timeouts

I have a great app for capturing shoutcast streams :-) . So far, it worked with a charm on dozens of machines, and never exhibited behaviour I found now, which is ultimately very strange. I use HttpWebRequest to connect to different shoutcast servers and when I connect two streams, everything's OK. When I go for third one, respon...

Accessing the buffered request body in HttpWebRequest?

By default HttpWebRequest has AllowWriteStreamBuffering set to true, which means that all data written to the request stream is buffered inside the object. I'd like to access this buffer of data after it has been written, but can't seem to find any way to do so. I'm happy for it to fail if AllowWriteStreamBuffering is false. Is there a...