0

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.

1 Answer 1

0

It is HTTP Status code. The HyperText Transfer Protocol (HTTP) 302 Found redirect status response code indicates that the resource requested has been temporarily moved to the URL given by the Location header.

See more here https://en.wikipedia.org/wiki/HTTP_302

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .