Sending a request body with an HTTP GET request

As explained here , it is technically allowed for a GET request to contain a request body, even if not recommended.

Unfortunately, I have to use an API that I have no control over and I need to send data to the body. It works fine in curl, but I cannot get it to work in C #.

As other threads explain, it looks like it cannot be done with WebRequest / WebClient as it will call Cannot send a content-body with this verb-type

. An often mentioned workaround to be used POST

instead of GET

undesirable with the API.

Are there existing libraries that extend .net classes to resolve this scenario? Implementing this directly above the TcpClient above my head.

+3


source to share





All Articles