As explained here it is technically allowed for GET request to contain a request body even though it is not recommended.
Unfortunateley I have to consume an API I have not control over that requires me to send data in the body. It works perfectly fine in curl but I cannot get it to work in c#.
As other threads explain it does not seem to be possible to do that using WebRequest/WebClient as this will throw Cannot send a content-body with this verb-type
. The often referred to workaround to use POST
instead of GET
is unfortunateley not possible with the API.
Are there any existing libraries that extend the .net classes in a way to allow this scenario? Implementing this myself on top of TcpClient is over my head.