httpwebrequest

Big files uploading (WebException: The connection was closed unexpectedly)

UPDATED See post #3 below. There is a need to upload a file to the web automatically (without browser). Host - Mini File Host v1.2 (if this does matter). Didn't find specific api in documentation, so at first i sniffed browser requests in Firebug as follows : Params : do Value : verify POST /upload.php?do=verify HTTP/1.1 Host: webfile...

Getting a file from an incoming POST HTTPWebRequest

Hi, I am being sent a Http POST request that includes a file. How can I get the file out of the HTTPWebRequest? ...

Handling Authentication with HttpWebRequest (.NET)

I am accessing a REST webservice from a VB app. I create a HttpWebResponse object and call GetRequestStream on it just fine, but when I call GetResponse I get a 401 exception. Here is my code (modified for posting): Dim webRequest = DirectCast(WebRequest.Create(endpoint), HttpWebRequest) webRequest.Method = "POST" webRequest.ContentLe...

Why does My HTTP Web Request Code Not Send a Request?

How to post the following HTTP requests in C# POST http://10.0.0.1/st_poe.cgi Accept: image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */* Referer: http://10.0.0.1/RST...

java inputstream print to console the content

sock = new Socket("www.google.com", 80); out = new BufferedOutputStream(sock.getOutputStream()); in = new BufferedInputStream(sock.getInputStream()); When i try to do printing out of content inside "in" like below BufferedInputStream bin = new BufferedInputStream(in); int b; while ( ( b = bin.read() ) != -1 ) { ...

Best practice: servlet that uses httpclient to post content

i want to write a java servlet that will be called by different users to do httpclient post content to another side via "POST" . i wanted to hear opinion from guru in this case, do my servlet need to use threadpool or something since i want to serve different users at the same time and each user is executing different httpclient post ...

re-use same session for each httpclient request

My java servlet call httpclient to get page content. may I know what is the best practice to re-use same session for same user when doing multiple sub sequence request from servlet ...

call httpclient from servlet

pseudo code service(..){ //httpclient get http://www.facebook.com } the above is pseudo code for java servlet, when user call this servlet service(..) from browser repeatly for instance 1. call http://localhost:8080/callService?url=facebook.com/index.php 2. call http://localhost:8080/callService?url=facebook.com/editprofile.p...

Very Slow WebResponse triggering TimeOut

Hello: I have a function in C# that fetches the status of Internet by retrieving a 64b XML from the router page public bool isOn() { HttpWebRequest hwebRequest = (HttpWebRequest)WebRequest.Create("http://" + this.routerIp + "/top_conn.xml"); hwebRequest.Timeout = 500; HttpWebResponse hWebResp...

How do I simulate the usage of a sequence of web pages?

I have a simple sequence of web pages written in ASP.Net 3.5 SP1. Page1 - A Logon Form.... txtUsername, txtPassword and cmdLogon Page2 - A Menu (created using DevExpress ASP.Net controls) Page3 - The page redirected to by the server in the event that the user picks the right menu option in Page2 I would like to create a threaded pr...

Is there any reason not to use HTTP PUT and DELETE in a web application?

Looking around, I can't name a single web application (not web service) that uses anything besides GET and POST requests. Is there a specific reason for this? Do some browsers (or servers) not support any other types of requests? Or is this only for historical reasons? I'd like to make use of PUT and DELETE requests to make my life a lit...

HttpWebRequest reades only homepage

Hi I tried to read a page using HttpWebRequest like this string lcUrl = "http://www.greatandhra.com"; HttpWebRequest loHttp = (HttpWebRequest)WebRequest.Create(lcUrl); loHttp.Timeout = 10000; // 10 secs loHttp.UserAgent = "Code Sample Web Client"; HttpWebResponse loWebResponse = (HttpWebResponse)loHttp.GetRespons...

C# Serialize XmlDocument & send via HTTPWebRequest

I'm trying to figure out how to properly serialize my XmlDocument and send it via a HTTPWebRequest object. Heres what I have thusfar: Stream requestStream; HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://wwwcie.ups.com/ups.app/xml/Track"); request.Method = "POST"; request.ContentType = "application/x-www-form-urle...

How does HttpWebRequest differ (functional) from pasteing a URL into an address bar?

I'm narrowing in on an underlying problem related to two prior questions. Basically, I've got a URL that when I fetch it manually (paste it into browser) works just fine, but when I run through some code (using the HttpWebRequest) has a different result. The URL (example): http://208.106.250.207:8192/announce?info_hash=-%CA8%C1%C9rDb...

How to keep an App Engine/Java app running with deaf requests from a Java/Python web cron?

App Engine allows you 30 seconds to load your application My application takes around 30 seconds - sometimes more, sometimes less. I don't know how to fix this. If the app is idle (does not receive a request for a while), it needs to be re-loaded. So, to avoid the app needing to be reloaded, I want to simulate user activity by pingin...

How to perform a fast web request in C#

I have a HTTP based API which I potentially need to call many times. The problem is that I can't get the request to take less than about 20 seconds, though the same request made through a browser is near instantaneous. The following code illustrates how I have implemented it so far. WebRequest r = HttpWebRequest.Create("https://example...

HttpWebRequest Limitations? Or bad implementation

I am trying to build a c# console app that will monitor about 3000 urls (Just need to know that HEAD request returned 200, not necessarily content, etc.) My attempt here was to build a routine the checks the web URLS, looping and creating threads each executing the routine. What's happening is if i run with <20 threads, it executes ok ...

RSS Video Feed Enhancement - Need to get duration on items that dont include it in feed

I have a working DNLA device (Xbox360, PSP...) RSS Video feed reader in C#. It parses .opml files to get the feed uri. Sometimes an RSS feed item will not have a duration value, so I am hard coding a default duration value when it doesn't. I want to get the true duration of the video file. My idea is to use httpWebRequest to get a b...

Handling Errors from HttpWebRequest.GetResponse

Hey experts - I'm having a ridiculous time trying to get an SMS API working (ZeepMobile, if you're interested) with .NET... I've been around .NET for a few years, but with all this social networking and API stuff, I need to get into the HttpWebRequest a bit. I'm new at it, but not completely new; I was able to hook up my site to Twitte...

ASP.NET: httpwebrequest date header workaround

I'm trying to integrate with an API that requires the "Date" header in a web request. As you may well know, .NET has removed the ability to append or even display a default Date header in your request, so I was wondering about a workaround. Here's the catch: you can't use TCPClients because I don't have "permissions" on my server for su...