REST connector is not automatically redirecting
Troubleshoot problems with REST URL redirect responses by learning about the default behavior of REST connectors.
The REST connector fails with unexpected results when the endpoint returns a 3xx HTTP response code.
The endpoint returns a response code that indicates that the REST connector should redirect the request to a different endpoint URL.
Resolving REST URL redirect response problems
Familiarize yourself with the default behavior for REST connectors when they handle different URL redirect response codes for different HTTP methods.
- REST connectors automatically redirect GET requests.
- REST connectors automatically redirect POST or PATCH requests that result in a 303 response, but the redirect is sent as a GET request instead.
- REST connectors do not automatically redirect POST, PATCH, PUT, or DELETE requests that result in a 301, 302, 307, or 308 response.
Use the following local change recommendation about making a second REST call when needed:Configure a second REST call that takes the value of the header that returns the redirect location. Use that header in the second call to split the REST calls into 2 parts. If the REST call returns a 3xx response code with a Location header value, pull the header value out and use it as the endpoint for the subsequent REST call.
To avoid building custom configuration, make sure to take the latest Pega Platform 8.x patch release. The latest patch release offers more configuration options on the Connect REST rule form.For more information, see Creating a Connect REST rule.