I am testing a REST service in dev console and I'm getting a status of Found
and a status code of 302
. However, the body is empty and I know the parameter value returns a record from the system that I'm making the callout.
Here is the code I'm executing:
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('callout:myNamedCredential/https://myRESTendpointURL/api/now/table/mytable?myparam=xxxxxxxxxxxx');
request.setMethod('GET');
HttpResponse response = http.send(request);
system.debug('*************************************************** request sent');
system.debug('*************************************************** response ' + response);
system.debug('*************************************************** response status code ' + response.getStatusCode());
if (response.getStatusCode() == 200) {
system.debug('*********************************************** we have a found status code');
system.debug('*********************************************** response body ' + response.getBody());
}
I looked in the developer guide for the REST API status codes and error responses and I do not see the 302
status code. I'm trying to identify the status code and status value and understand what it means.