SetAuthorizationKey


New to Analytica 6.6

Function _SetAuthorizationKey( urlPrefix, authorization )

Many web services or other HTTP sources require that an authentication header to grant access or use. There is a standard HTTP header named Authentication used for this purpose.

This function informs Analytica of an authorization value that must be used for any URL that starts with «urlPrefix». When Analytica accesses a URL with that prefix, it will automatically insert the Authorization header with the indicated «authorization» value (except in the case where you have specified an Authorization header in that context, in which case yours would override the one remembered by this function).

In some cases, such as when calling ReadFromURL, this can reduce the extra require parameters. In other cases, there might not be any other mechanism for specifying the HTTP headers.

Since you only want to call this once, you will usually place the call inside a button. It might be a button that collects credentials from the user, for example, or it might be a button that is launched on model load.

When there are multiple prefix matches, the longest match is used.

Parameters

«urlPrefix»
The URL or a prefix of the URL that the authorization will be used for. This must include the protocol scheme, e.g., "https://calendar.googleapis.com", and not just the domain. In some cases it may include a port, e.g., "http://localhost:3333".
«authorization»
The full contents to be sent for the Authorization header. To remove the authorization for this «urlPrefix», pass Null.

See Also

Comments


You are not allowed to post comments.