Is it possible to return the Stream from HttpWebResponse.GetResponseStream() from a streamaccessor method? I have a streamaccessor that returns blobs stored on an external web server using the following statements. When I return the stream returned
by HttpWebResponse.GetResponseStream(), I get an error stating that it "Failed to retrieve data from the External System: 'Error - No content exists for this field'".
If I uncomment out the bold portion and return a MemoryStream instead then it works fine. While returning a MemoryStream is fine for development, it will not work in production. I would also prefer to not write the file to disk. I cannot
find anything in the logs stating why it thinks there is no content.
public static Stream GetDocument(string DocumentUri, string username, string password)
// code that generates the url removed.
string url = urls.First().Value;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
View Complete Post