How do you do a HttpRequest for a GET method with a request body? For some reason this GET method is getting converted to POST and is not successful. This is working via postman.
Http http = new Http();
HttpRequest request = new HttpRequest();
HttpResponse response;
request.setEndpoint('http://www.someendpoint.com/getdata');
request.setMethod('GET');
String requestBody = '{ "accountId": "123345" }';
request.setBody(requestBody);
response = http.send(request);
We are getting the following
{
"errors" : [ {
"message" : "Request method 'POST' not supported",
"type" : "HttpRequestMethodNotSupportedError"
} ]
}
String requestBody = '{ "accountId": "123345" }';
?