Is there anyway to prevent HttpWebRequest.GetRequestStream
from throwing an exception when the method is GET
? I know that HEAD
and GET
should not contain a body in valid HTTP, but some servers accept bodies for these methods anyway (e.g., Elasticsearch's _search
feature). I have an open source project for doing REST calls and I was wondering if I could circumvent this behavior to avoid surprises.
At some point, I will probably create a version of my library using the new System.Net.Http.HttpClient
class. Does this class have the same restrictions?