-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
After upgrading to v107, I started getting the following error when trying to execute a GET request with the Content-Type: application/force-download header:
Cannot send a content-body with this verb-type.
The header is the only parameter in the request, but it seems like RestSharp transparently adds a body causing the error.
All attempts below causes the error mentioned when executing the request:
restRequest.AddHeader("Content-Type", "application/force-download");
restRequest.Parameters.AddParameter(new BodyParameter("", "", "application/force-download", DataFormat.None));
restRequest.AddStringBody("", "application/force-download");
While it may not be a good practice to use this header parameter with a GET request, it is unfortunately required for me to perform some operation with a system from a vendor and the last version of RestSharp does not support this anymore.