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…

user1260249
- 115
- 8
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)
{
…

user3559014
- 51
- 4
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…

Federico Quirós
- 55
- 3
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 =…

user3638757
- 41
- 4
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
1
vote
0 answers
Is it possible to only read and return a part of HttpWebResponse.GetResponseStream?
I've searched everywhere, and I can't seem to find any place that answers this for me... Would really be great if anyone could help.
So basically, I've recently made a program in C# that's supposed to check certain parts of a site's source code, and…

Max
- 897
- 1
- 10
- 27
1
vote
0 answers
How do I decide on a buffer size when downloading a file using HttpWebRequest and HttpWebResponse?
I'm using HttpWebRequest / HttpWebResponse to download an image file from a remote server to my own web server. The code is working fine, but I don't know if the buffer size I've chosen is the optimum size for best performance.
How would I go about…

Simon White
- 789
- 2
- 8
- 16
0
votes
1 answer
Try to understand HttpWebRequest.GetResponseStream
i am trying to understand how GetResponseStream works.
when I do request.GetResponseStream, does it download all the data then return the Stream object?

Eatdoku
- 6,569
- 13
- 63
- 98
0
votes
2 answers
How to cancel reading from a Stream obtained using HttpWebResponse.GetResponseStream()?
I use HttpWebResponse.BeginGetResponse() method to make a request to my server. In the "Request Complete" notification I do the following (no error handling code included):
HttpWebResponse response =…

Mihai
- 89
- 6