Questions tagged [getresponsestream]

29 questions
28
votes
6 answers

What is the best way to read GetResponseStream()?

What is the best way to read an HTTP response from GetResponseStream ? Currently I'm using the following approach. Using SReader As StreamReader = New StreamReader(HttpRes.GetResponseStream) SourceCode = SReader.ReadToEnd() End Using I'm not…
Dev Dona
5
votes
2 answers

Copy file from remote server to client browser via my server without writing the entire file to disk or memory

This is the scenario. There is a file on a remote file server (say I have a file hosted on DropBox) I want to offer that file as a download on my web application (c# asp.net 4.0) I want to hide the location 100% of the original file (I want it to…
3
votes
1 answer

HttpWebRequest GetRequestStream SystemException after several calls randomly

I have a program in C# .NET 3.5 CompactFramework that requests data from a C# WebService: public SynchronisationResult Get(IEnumerable existingObjects, string controller, string parameters) where J : IdJsonObject) { …
3
votes
2 answers

Deserializing XML from HttpWebResponse GetResponseStream with different types

I am calling a web service. It accepts Http Post. It is simple XML over Http. You send it an XML request document in the body of the request, you get back an XML response document in the body of the response. I have a nice library in our code base…
Michael Levy
  • 13,097
  • 15
  • 66
  • 100
2
votes
3 answers

NullReferenceException reading from an asynchronous HttpWebRequest stream

I'm programming an application for Windows Phone 7. This application firstly sends, and then receives data from a server via HttpWebRequest. Most times it works fine, but sometimes, after receiving a portion of the data properly, I get a…
2
votes
1 answer

Abot Crawler - How to detect null response

I am using vb.net and have a handful of URLs that refuse to be crawled. I would really like to detect when a crawl returns a null response, but seem to be having a problem figuring out HOW. Code: Public Sub crawler_ProcessPageCrawlCompleted(sender…
Andrew
  • 437
  • 7
  • 18
2
votes
1 answer

How do I check for binary vs. text in an HttpWebRequest in c#?

Is there a way to determine if the response from an HttpWebRequest in C# contains binary data vs. text? Or is there another class or function I should be using to do this? Here's some sample code. I'd like to know before reading the StreamReader if…
fehays
  • 3,147
  • 1
  • 24
  • 43
2
votes
1 answer

Return GetResponseStream output to another function , What about respone disposing

i'm working on download manager project and i'm using : public Stream GetStream(string url) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); return…
Omar
  • 31
  • 7
1
vote
0 answers

first HttpWebResponse.GetResponseStream() fails, second one works?

I am creating a program that auto login into a website using forms authentication. When ever I call my method to connect to the website, it returns me a empty document text. However, if I call the same method a second time, it works perfectly. Here…
BecoZ
  • 109
  • 2
  • 10
1
vote
1 answer

"Value of 'null' is not valid for stream"

Attempting to download an image from a URL into memory. Getting an error on the response stream. Exception calling "FromStream" with "1" argument(s): "Value of 'null' is not valid for 'stream'." Function Download-Image { $req =…
1
vote
2 answers

PHP dropdown value need to save

I'm having trouble with the current PHP dropdown and I'm posting this to get some shine of light. Here's the HTML dropdown code