Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
Response = HTTPClient_Services(Service, Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10@Service, @Params)

Returns

The meaning of the response value depends on the service.

Parameters

ParameterDescription
Service
@ServiceThe name of the service being requested. Required.
Param1 - Param10
@ParamsGeneric parameters. Refer to a specific service to determine the actual parameters used.

Remarks 

HTTPClient_Services provides very useful application services so OpenInsight applications can make HTTP requests to other web servers. The response to each request is kept in memory until the next request is made, thus allowing the developer to get various HTTP response results when it is convenient (such as the body, status code, or response header values).

Services

ServiceDescription
SendHTTPRequest

Usage:
HTTPClient_Services('SendHTTPRequest', Method, URL, HeaderList, Body, ProxyUser, ProxyPassword, UseAsynchronous, ClientToUse, ClientCertPath,

UseXMLHTTP

ResponseIsBinary)

Comments:
Calls the indicated HTTP web service routine. This is the primary service of this module. All other services either support this SendHTTPRequest or are dependent upon SendHTTPRequest completing a request. The arguments are defined as follows:

ArgumentDescriptionImportance
MethodThe HTTP method to submit to the server.Required
URLThe URL receiving the HTTP request.Required
HeaderListAn @FM/@VM list of request header names and values.Optional
BodyThe request body to be sent to the server.Optional
ProxyUserUsername needed to authenticate against a proxy serverOptional
ProxyPasswordPassword needed to authenticate against a proxy server.Optional
UseAsynchronousFlag to determine if the HTTP request should be processed asynchronously. Default is True.Optional
ClientToUseHTTP client to use for the request. Options are ClientXMLHTTP, ServerXMLHTTP, or PowerShell. If True$ is passed in then ClientXMLHTTP will be used. If False$ is passed in then ServerXMLHTTP will be used. If any other value is passed in (including an empty string) then ServerXMLHTTP will be used. This will allow for backwards compatibility.Optional
ClientCertPathPath to a client-side certificate. This is usually in Location\Certificate Store\Subject format.Optional
ResponseIsBinaryBoolean flag to indicate if the response is expected to be binary. Default is False$.Optional

Returns:
The HTTP response body from the server. The HTTP response body can also be retreived via the GetResponseBody service.

SetRequestHeaderFields

Usage:
HTTPClient_Services('SetRequestHeaderFields',

Method, URL,

HeaderList

, Body, ProxyUser, ProxyPassword, UseAsynchronous, UseXMLHTTP

)

Comments:

Calls

Sets the

indicated HTTP web service routine

Request Header Fields as indicated by the HeaderList argument. The HeaderList should not be formatted as a list rather than an associated multivalue array. This is easier for the developer to manage in the code that calls this service.

Returns:

The HTTP response body from the server.

N/A

SetRequestHeaderField

Usage:
HTTPClient_Services('SetRequestHeaderField',

Method, URL, HeaderList, Body, ProxyUser, ProxyPassword, UseAsynchronous, UseXMLHTTP

Name, Value)

Comments:

Calls

Sets the indicated Request Header Field with the indicated

HTTP web service routine

value.

Returns:

The HTTP response body from the server.

N/A

GetRequestHeaderFields

Usage:
HTTPClient_Services('GetRequestHeaderFields'

, Method, URL, HeaderList, Body, ProxyUser, ProxyPassword, UseAsynchronous, UseXMLHTTP

)

Comments:

Calls the indicated HTTP web service routine

Returns all of the Request Header Field names and values. This returns an @FM/@VM list of names and values. This is called from the SendHTTPRequest service automatically. The developer does not need to use this service.

Returns:

The HTTP response body from the server

An @FM/@VM list of request header names and values.

GetRequestHeaderField

Usage:
HTTPClient_Services('GetRequestHeaderField',

Method, URL, HeaderList, Body, ProxyUser, ProxyPassword, UseAsynchronous, UseXMLHTTP

Name)

Comments:

Calls

Returns the value previously set for the indicated

HTTP web service routine

Request Header Field.

Returns:
The

HTTP response body from the server

value previously set for the indicated Request Header Field.

SetResponseHeaderField

Usage:
HTTPClient_Services('SetResponseHeaderField',

Method, URL, HeaderList, Body, ProxyUser, ProxyPassword, UseAsynchronous, UseXMLHTTP

Name, Value)

Comments:

Calls the indicated HTTP web service routine

Sets the indicated Response Header Field with the indicated value. This is called from the SendHTTPRequest service automatically after retrieving the response headers fields from the server.

Returns:

The HTTP response body from the server.

N/A

GetResponseHeaderFields

Usage:
HTTPClient_Services('GetResponseHeaderFields'

, Method, URL, HeaderList, Body, ProxyUser, ProxyPassword, UseAsynchronous, UseXMLHTTP

)

Comments:

Calls the indicated HTTP web service routine

Returns all of the Response Header Field names and values. This returns an @FM/@VM list of names and values.

Returns:

The HTTP response body from the server

An @FM/@VM list of response header names and values.

GetResponseHeaderField

Usage:
HTTPClient_Services('GetResponseHeaderField',

Method, URL, HeaderList, Body, ProxyUser, ProxyPassword, UseAsynchronous, UseXMLHTTP

Name, Delimiter)

Comments:

Calls the indicated HTTP web service routine

Returns the value previously set for the indicated Response Header Field. The Name argument is case-insensitive but if the indicated Response Header Field has not been set then an error condition will be set.

Returns:
The

HTTP response body from the server

value previously set for the indicated Response Header Field

SetResponseStatusCode
GetCookie

Usage:
HTTPClient_Services('

SetResponseStatusCode

GetCookie',

Method, URL, HeaderList, Body, ProxyUser, ProxyPassword, UseAsynchronous, UseXMLHTTP

Name, IgnoreAttributes)

Comments:
Returns the value for the indicated cookie name. If the IgnoreAttributes argument is True the cookies attributes will be removed. See this section of RFC6265 and following for examples of cookie attributes. The default value for IgnoreAttributes is False.

Returns:
See comments.

GetCookies

Usage:
HTTPClient_Services('GetCookies', Delimiter)

Comments:

Calls the indicated HTTP web service routine.

Returns all cookie strings from the response headers using the indicated delimiter. If the Delimiter argument is empty, all cookie strings will be delimited with @FM.

Returns:
See comments.

SetResponseStatusCode

Usage:
HTTPClient_Services('SetResponseStatusCode', Code)

Comments:
Sets the response status code generated by the most recent HTTP request. This is called from the SendHTTPRequest service automatically after retrieving the response status from the server.

Returns:
N/A

Returns:
The HTTP response body from the server. 

GetResponseStatusCode

Usage:
HTTPClient_Services('GetResponseStatusCode'

, Method, URL, HeaderList, Body, ProxyUser, ProxyPassword, UseAsynchronous, UseXMLHTTP

)

Comments:

Calls the indicated HTTP web service routine

Gets the response status code generated by the most recent HTTP request.

Returns:
The

HTTP response body from the server. 

response status code generated by the most recent HTTP request.

SetResponseStatusPhrase

Usage:
HTTPClient_Services('SetResponseStatusPhrase',

Method, URL, HeaderList, Body, ProxyUser, ProxyPassword, UseAsynchronous, UseXMLHTTP

Phrase)

Comments:

Calls the indicated HTTP web service routine

Sets the response status phrase generated by the most recent HTTP request. This is called from the SendHTTPRequest service automatically after retrieving the response status phrase from the server.

Returns:

The HTTP response body from the server. 

N/A

GetResponseStatusPhrase

Usage:
HTTPClient_Services('GetResponseStatusPhrase'

, Method, URL, HeaderList, Body, ProxyUser, ProxyPassword, UseAsynchronous, UseXMLHTTP

)

Comments:

Calls the indicated HTTP web service routine

Gets the response status phrase generated by the most recent HTTP request.

Returns:
The

HTTP response body from the server. 

response status phrase generated by the most recent HTTP request.

SetResponseBody

Usage:
HTTPClient_Services('SetResponseBody'

, Method

,

URL, HeaderList,

Body

, ProxyUser, ProxyPassword, UseAsynchronous, UseXMLHTTP

)

Comments:

Calls the indicated HTTP web service routine.Returns:
The HTTP

Sets the response body generated by the most recent HTTP request. This is called from the SendHTTPRequest service automatically after retrieving the response body from the server.

 

Returns:
N/A

GetResponseBody

Usage:
HTTPClient_Services('GetResponseBody'

, Method, URL, HeaderList, Body, ProxyUser, ProxyPassword, UseAsynchronous, UseXMLHTTP

)

Comments:

Calls the indicated HTTP web service routine

Gets the response body generated by the most recent HTTP request. This is the same response that the SendHTTPRequest service returns.

Returns:
The

HTTP

response body

from the server

generated by the most recent HTTP request.

SetTimeoutDuration

Usage:
HTTPClient_Services('SetTimeoutDuration',

Method, URL, HeaderList, Body, ProxyUser, ProxyPassword, UseAsynchronous, UseXMLHTTP

TimeoutDuration)

Comments:

Calls the indicated HTTP web service routine

Sets the timeout duration that will be used before an HTTP request will abort. This is only applicable if the request is asynchronous. If the timeout duration is empty, a default setting of 30 minutes (1800 seconds) will be set.

Returns:

The HTTP response body from the server. 

N/A

GetTimeoutDuration

Usage:
HTTPClient_Services('GetTimeoutDuration'

, Method, URL, HeaderList, Body, ProxyUser, ProxyPassword, UseAsynchronous, UseXMLHTTP

)

Comments:

Calls the indicated HTTP web service routine

Returns the timeout duration that will be used before an HTTP request will abort. This is only applicable if the request is asynchronous. If the timeout duration is empty, a default setting of 30 minutes (1800) seconds) will be returned.

Returns:
The

HTTP response body from the server

timeout duration that will be used before an HTTP request will abort.

ClearResponseSettings

Usage:
HTTPClient_Services('ClearResponseSettings'

, Method, URL, HeaderList, Body, ProxyUser, ProxyPassword, UseAsynchronous, UseXMLHTTP

)

Comments:

Calls the indicated HTTP web service routine

Clears all of the global common variables used for responses. This is called from the SendHTTPRequest service automatically. The developer does not need to use this service.

Returns:

The HTTP response body from the server.

N/A

ClearRequestSettings

Usage:
HTTPClient_Services('ClearRequestSettings'

, Method, URL, HeaderList, Body, ProxyUser, ProxyPassword, UseAsynchronous, UseXMLHTTP

)

Comments:

Calls the indicated HTTP web service routine

Clears all of the global common variables used for requests. This is called from the SendHTTPRequest service automatically. The developer does not need to use this service.

Returns:

The HTTP response body from the server.

...

N/A

Params

The proper use of the generic arguments are defined in the definition of each service above.