FollowRedirects Property

Determines what happens when the server issues a redirect.

Syntax

ANSI (Cross Platform)
int GetFollowRedirects();
int SetFollowRedirects(int iFollowRedirects); Unicode (Windows) INT GetFollowRedirects();
INT SetFollowRedirects(INT iFollowRedirects);

Possible Values

FR_NEVER(0), 
FR_ALWAYS(1),
FR_SAME_SCHEME(2)
@property (nonatomic,readwrite,assign,getter=followRedirects,setter=setFollowRedirects:) int followRedirects;
- (int)followRedirects;
- (void)setFollowRedirects:(int)newFollowRedirects;

Possible Values

FR_NEVER(0), 
FR_ALWAYS(1),
FR_SAME_SCHEME(2)
#define PID_REST_FOLLOWREDIRECTS 20

IPWORKS_EXTERNAL void* IPWORKS_CALL IPWorks_REST_Get(void *lpObj, int propid, int arridx, int *lpcbVal, int64 *lpllVal);
IPWORKS_EXTERNAL int IPWORKS_CALL IPWorks_REST_Set(void *lpObj, int propid, int arridx, const void *val, int cbVal);

Default Value

0

Remarks

This property determines what happens when the server issues a redirect. Normally, the class returns an error if the server responds with an "Object Moved" message. If this property is set to frAlways (1), the new URL for the object is retrieved automatically every time.

If this property is set to frSameScheme (2), the new URL is retrieved automatically only if the URLScheme is the same, otherwise the class fails with an error.

Note that following the HTTP specification, unless this property is set to frAlways (1), automatic redirects will be performed only for 'GET' or 'HEAD' requests. Other methods could potentially change the conditions of the initial request and create security vulnerabilities.

Furthermore, if either the new URL server and port are different than the existing one, User and Password are also reset to empty, unless this property is set to frAlways (1), in which case the same credentials are used to connect to the new server.

A Redirect event is fired for every URL the product is redirected to. In the case of automatic redirections, the Redirect event is a good place to set properties related to the new connection (e.g. new authentication parameters).

The default value is frNever (0). In this case, redirects are never followed, and the class fails with an error instead.

Data Type

Integer

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks 2020 C++ Edition - Version 20.0 [Build 8307]