I'm doing this in C#:
Image image = Image.FromStream(fullSizeAppLogo.FileStream);
The FileStream property is defined in a separate class as:
public System.IO.Stream FileStream
{
get
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(this.Url);
return request.GetRequestStream();
}
}
Where 'this.Url' is the URL of the image I'm trying to retrieve. I get the error 'Cannot send a content-body with this verb-type', on this line:
return request.GetRequestStream();
So it seems that the request.GetRequestStream is a GET request, whereas this line:
Image.FromStream(fullSizeAppLogo.FileStream)
seems to be trying to send a content body. I don't understand why Image.FromStream would be trying to send a content body - why would this be the case?
It doesn't seem right to fix this error by changing the method of my 'request' object to POST, since the HttpWebRequest should really be doing a GET request of the URL, so this surely can't be a valid fix for the issue. What's a 'correct' way to fix this issue?