URL redirects

With a server-side URL redirect a server indicates to a client that a requested server resource has been moved permanently or temporarily. Such redirects are not automatically evaluated in the IoT driver. It is therefore left to the application logic to evaluate a URL redirect.

Example: HTTP status code 301 ("Moved permanently"). This is where a server notifies a client that a server resource has been moved permanently. A header field with the name "Location" is added to the HTTP response, so that the client can be notified of the new address of the resource. This header field then contains the new URL where the resource is located.

In a TwinCAT application, after receiving an HTTP response via the status code query, an application logic could be implemented that extracts the new URL from a response with status code 301 and sends a new request with the updated URL to the server. To do this, the "Location" header field of the response must be queried and used as the target URL for a new request.