Redirects - REST vs. SOAP
The one major difference between the REST and SOAP integrations is how redirects are handled in the query responses. Redirects are configured in the Merchandising Studio to redirect the user to an alternative URL address when they have used a specific term or phase in the search field. A typical example would be to redirect the user to the contact page of your web application when they search for the term 'contact us'. In a SOAP integration, the URL to redirect the user to gets included in the body of the XML response that is returned in a section and this response will have a HTTP code 200. In a REST implementation, the HTTP standards are followed and by default an HTTP code 302 is returned with the redirect URL in the Location header of the response which the web browser will action automatically. The body of the response is empty in this case.
When using the REST integration and if it is required, it is possible to instruct Fredhopper to follow the same behaviour as SOAP so that a redirect URL will get provided in the body of the standard XML/JSON response rather than using the HTTP 302 code standard. To achieve this you would simply need to provide the following entry in the header section of the HTTP request query: User-Agent: XML only client.
Please find an example request below that includes the additional value in the HTTP header:
Last updated