HTTP Client Object
Overview
No certificate is passed to the server unless it is explicitly set by the SetCertificate method of the HTTP Client Object. If the certificate is not set, communication between client and server may fail in cases where the server requires client authentication.
Private Communications Technology (PTC) is not a supported protocol for HTTP Client Objects.
note
The HTTP Client Object natively only supports the gzip and deflate encodings. Responses that use these encodings will be automatically decompressed if the Accept-Encoding: gzip,deflate header is added to the request (with the value "gzip" and/or "deflate"). If any other encoding is specified in the request or sent by the server, the body must be manually decompressed.
Sections
Init, Main, Procedures, OnExit, and Structure.
note
The object is declared in the Declare section.
Properties
Name | Description |
---|---|
Protocol | Security protocol for secure connections. |
ProxyHost | Security protocol for secure connections. |
ProxyPassword | Password to be sent on all requests through a proxy server that requires authentication. |
ProxyPort | Specifies the port used by the proxy server that requests are to be routed through. |
ProxyType | The type of proxy server used for this connection. |
ProxyUsername | Username to be sent on all requests through a proxy server that requires authentication. |
Redirect | Specifies whether auto redirection is to take place. |
Request | The request to be sent to the server. |
Response | The response from the server. |
Security | Sets the security level. |
Timeout | Timeout in milliseconds for communication commands. |
ObjectIsEmpty | Returns 1 if object is not created. |
LastReturnCode | Returns last known return code from object. |
note
Properties ObjectIsEmpty
and LastReturnCode
are common methods. For more information see Common properties and methods.
Methods
Name | Description |
---|---|
ClearCertificate | Clears the Certificate set earlier. |
Command | Sends a command to the server. |
Get | Retrieves data from the server. |
Head | Retrieves header data from the server. |
Post | Sends data to the server for processing. |
Put | Stores data on the server. |
SetCertificate | Points out the certificate used to authenticate secure connections. |
StartTrace | Starts a trace of HTTP communication to file. |
StopTrace | Stops trace of HTTP communication. |
CreateObject | Creates a new instance of the object. |
FreeObject | Releases the instance of the object. |
note
Methods CreateObject
and FreeObject
are common methods. For more information see Common properties and methods.
See also
HTTP Header Fields Object
HTTP Request Message Object
HTTP Response Message Object
HTTP Request Object
HTTP Response Object
HTTP Session Object
Cookie Object
iCore HTTP Server Object
Properties
Protocol
Security protocol for secure connections. For more information, see General information about SSL and TLS.
Parameters
Type: SecureProtocolType
Default: secprotAuto
Read: get_Protocol
Write: put_Protocol
ProxyHost
Specifies the name or address of the proxy server that requests are to be routed through.
Type:
Default: -
Read: get_ProxyHost
Write: put_ProxyHost
See also
HTTP Client Object::ProxyPassword
HTTP Client Object::ProxyPort
HTTP Client Object::ProxyType
HTTP Client Object::ProxyUsername
ProxyPassword
Password to be sent on all requests which go through a proxy server that requires authentication.
Type:
Default: -
Read: get_ProxyPassword
Write: put_ProxyPassword
See also
HTTP Client Object::ProxyHost
HTTP Client Object::ProxyPort
HTTP Client Object::ProxyType
HTTP Client Object::ProxyUsername
ProxyPort
Specifies the port used by the proxy server that requests are to be routed through.
Type:
Default: -
Read: get_ProxyPort
Write: put_ProxyPort
See also
HTTP Client Object::ProxyHost
HTTP Client Object::ProxyPassword
HTTP Client Object::ProxyType
HTTP Client Object::ProxyUsername
ProxyType
The type of proxy server to be used for this connection.
Default: Proxy_None
Type:
Default: -
Read: get_ProxyType
Write: put_ProxyType
Remarks
ProxyType can have the following values:
Proxy_None | No proxy server. Straight connection. Value: 0 |
Proxy_Socks4 | Uses a SOCKS V4 Proxy. Value: 1 |
Proxy_Socks5 | Uses a SOCKS V5 Proxy. Value: 2 |
See also
HTTP Client Object::ProxyHost
HTTP Client Object::ProxyPassword
HTTP Client Object::ProxyPort
HTTP Client Object::ProxyUsername
note
If the proxy is of CERN proxy type, set ProxyType to Proxy_None. Other proxy properties should be set accordingly.
ProxyUsername
Username to be sent on all requests which go through a proxy server that requires authentication.
Type:
Default: -
Read: get_ProxyUsername
Write: put_ProxyUsername
See also
HTTP Client Object::ProxyHost
HTTP Client Object::ProxyPassword
HTTP Client Object::ProxyPort
HTTP Client Object::ProxyType
Redirect
Specifies whether auto redirection is to take place.
Type: HTTPRedirectConstants
Default: -
Read:
Write: put_Redirect
Remarks
HTTPRedirectConstants can have the following values:
HTTPRedirect_None | Do not allow any redirection at all. Value: 0 |
HTTPRedirect_All | Allow all redirection. Value: 1 |
HTTPRedirect_Same | Allow redirection from any source to a similar destination. Value: 2 |
HTTPRedirect_ToSecure | Allow redirection from a non-secure source to a secure destination. Value: 4 |
HTTPRedirect_ToNonSecure | Allow redirection from a secure source to a non-secure destination. Value: 8 |
Request
The request to be sent to the server.
Type:
Default: -
Read: get_Request
Write: put_Request
See also
Response
The response from the server.
Type:
Default: -
Read: get_Response
Write: put_Response
See also
Security
Sets the security level.
Default: HTTPSec_Normal – Apply all server certificate security checks.
Type: HTTPSecurityConstants
Default: -
Read:
Write: put_security
Timeout
Timeout in milliseconds for communication commands.
Default: 30000
Type: Integer
Default: -
Read: get_Timeout
Write: put_Timeout
Methods
ClearCertificate
Clears the Certificate set earlier.
Parameters
-
See also
HTTP Client Object::SetCertificate
Command
Sends a command to the server.
Parameters
Command | Type: String Description: The command to send. |
Get
Retrieves data from the server.
Parameters
-
See also
Head
Retrieves header data from the server.
Parameters
-
See also
Post
Sends data to the server for processing.
Parameters
-
See also
Put
Stores data on the server.
Parameters
-
See also
SetCertificate
Points out the certificate used to authenticate secure connections.
Use CertificateStoreName and StoreLocation to point out store.
Use IssuedBy and SerialNumber to point out the certificate in the chosen store.
Parameters
CertificateStoreName | Type: CryptStoreNameType Description: Name of certificate store. Example: "MY" |
StoreLocation | Type: StoreLocationValueType Description: Location of store. |
IssuedBy | Type: String Description: Certificate issuer. |
SerialNumber | Type: String Description: Serial number of the certificate. |
See also
HTTP Client Object::ClearCertificate
StartTrace
Starts a trace of HTTP communication to file.
Parameters
Filename | Type: [ParamTypeFilepath]../CommonDataTypes.md#paramtypefilepath) Description: Name of file. |
TraceSend | Type: ParamTypeBool Default: True_Value Description: |
TraceReceive | Type: ParamTypeBool Default: True_Value Description: |
SendPrompt | Type: String Default: S Description: |
ReceivePrompt | Type: String Default: R Description: |
See also
StopTrace
Stops trace of HTTP communication.
Parameters
-