httpwebrequest

ASP.Net Page HttpWebRequest takes ages to respond

Hi, Below is my code (ASP.net web project), but when i debug this asp page it takes ages to retrieve the response ? any idea why is this happening ? and also the providers of the aURl mentioned to use req.connection="Close" but when i use that throws out an error. (im new to httpwebrequest sigh) this is the documentation about co...

page loads very slowly after its left idle

If the leave the webpage (any webpage) on my web application for a while (say 15 min), if I again click on another page it takes a long time to load (20 seconds) I had a look through the google chrome --> developer module and found that, it is the web page which is the culprit here and the 'LATENCY' time for it is 17 seconds !!! and the...

Android HttpHost problem

Hi, why if i create a HtppHost object with: HttpHost host = new HttpHost("myservice/frontend_dev.php/api/, -1, HttpHost.DEFAULT_SCHEME_NAME); i obtain the following exception: java.net.UnknownHostException: Host is unresolved: myservice/frontend_dev.php/api/:80 I don't want the object include the :80 port in the request url Thanks...

Double postback caused by external resource timing out?

I have a .NET WebForm that calls a remote script via HTTPWebRequest/Response. Recently I started noticing that the button click handler that calls this script will fire twice - but only if the first request to the external resource takes longer than a minute or so. If it's over that threshold, the entire event handler seems to fire twice...

Dynamic assembly generated on HttpWebRequest.GetResponse()

It appears our application has an assembly leak. I noticed that on any calls where a web service call is invoked using the HttpWebRequest object a dynamic assembly is loaded on the call httpWebRequest.GetResponse() I can see the assembly get loaded through the debugger ('w3wp.exe' (Managed): Loaded '7-6jav6v', No symbols loaded.) but I ...

Doubt about HttpWebRequest class in .net

Hello, I would like to know two things about the following code: HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url); objRequest.Method = "POST"; objRequest.ContentLength = strPost.Length; objRequest.ContentType = "application/x-www-form-urlencoded"; myWriter = new StreamWriter(objRequest.GetRequestStream()); myWriter.W...

Downloading a file, and I get Content-Length header is Invalid

I'm downloading a file, from a webserver, using the code below, and am recieving this error: The Error: Error saving file from URL:The server committed a protocol violation. Section=ResponseHeader Detail='Content-Length' header value is invalid From running Fiddler while this is running, it says: Content-Length response header is not...

How to use httpwebrequest to pull image from website to local file

Hello, I'm trying to use a local c# app to pull some images off a website to files on my local machine. I'm using the code listed below. I've tried both ASCII encoding and UTF8 encoding but the final file is not an correct. Does anyone see what I'm doing wrong? The url is active and correct and show the image just fine when I put the...

HttpWebRequest sessionID c# login

Im trying to login to a website (www.vodafone.ie) with a console app and c# httpWebRequest. Problem is it works ok about 50% of the time. Im using fiddler to find out the GET and POST requests I need to make. Done that and my app is successfully recreating these as best as I can see. The steps are; 1) GET request with cookie container ...

WebRequests are slow (taking 4 seconds) how do I speed them up?

I'm doing a web request that is too slow. It takes around 3.2 seconds to GetResponseStream() and .8 seconds to ReadToEnd() If I run the same request in a web browser I get a response in less than a second... I'm wondering what I can do to speed up the request and what might cause it to be slow? Based on other questions I saw here, I di...

python library for file upload and persistent connections?

Hi, I tried urllib{2}, pycurl and I'm looking at twisted's new http client. But: I found urllib2 difficult to perform a file upload pycurl multi looks right but unpythonic twisted's http client does not support persistent connection (didn't check the file upload capability) Is there any other alternative? ...

Getting redirect information with C# and C++

Hi all. What am I doing wrong? I'm trying to get redirect information from a server that I use for authenticating a user. This works good with my C# code but I cannot make my C++ code working. So here's the working C# code: string postData = @"username=myUsername&serviceID=someServiceId&password=somePassword"; byte[] postBytes = Encodin...

What might cause the big overhead of making a HttpWebRequest call?

When I send/receive data using HttpWebRequest (on Silverlight) in small blocks, I measure the very small throughput of 500 bytes/s over a "localhost" connection. When sending the data in large blocks, I get 2 MB/s, which is some 5000 times faster. Does anyone know what could cause this incredibly big overhead? Additional info: I'm...

What is a good, free, AJAX PHP solution for creating a grid with right-click functionality?

I'd like to construct a grid, preferably with pagination built in, and do GETs POSTs etc from a right click submenu and have the grid update. We were using Ext but we found it do be too bulky for our uses. Can anyone recommend another library that is easy to use? Thank you in advance. ...

How to diagnose "the operation has timed out" HttpException

I am calling 5 external servers to retrieve XML-based data for each request for a particular webpage on my IIS 6 server. Present volume is between 3-5 incoming requests per second, meaning 15-20 outgoing requests per second. 99% of the outgoing requests from my server (the client) to the external servers (the server) work OK but about 1...

How to access localhost websites through http request from blackberry simulator?

Hi Everybody I am developing a blackberry application and i wanted to access the websites from my localhost( local machine). I am running the application on blackberry simulator 8350. From my code i can browse request any website from internet and i am getting the response. When i am trying to give the url as localhost:8080/portal/in...

Random JSON Generator

Hi, I need a tool which generates random JSON objects. I want to use this tool to do testing on my HTTP POST requests and use the random JSON object in it. Any suggestions? ...

Fetching data (responsebody) with a HttpClient in an AsyncTask and returning the data outside the AsyncTask to the UI-thread

Basically I'm wondering how I'm able to do what I've written in the topic. I've looked through many tutorials on AsyncTask but I can't get it to work. I have a little form (EditText) that will take what the user inputs there and make it to a url query for the application to lookup and then display the results. What I think would seem t...

Managing execution priorities and request expiry time in your web application

Some installations that run our applications can be under hefty stress on a busy day. Our clients ask us is there is a way to manage priorities in our application. For example, in a typical internet banking application, banks are interested in having the form “Transfer money” responsive, while the “Statement” page is a lot less critical....

CacheManager.getCacheFileBaseDir() always returns null

I've been trying to use the CacheManager for caching some http requests but it failed every time with a nullpointer exception. After some digging I believe I found out why: CacheManager.getCacheFileBaseDir() always returns null so when I try to use CacheManager.getCacheFile() or CacheManager.saveCacheFile() they fail. CacheManager.cach...