Skip to main content
Version: 4.2.5

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

NameDescription
ProtocolSecurity protocol for secure connections.
ProxyHostSecurity protocol for secure connections.
ProxyPasswordPassword to be sent on all requests through a proxy server that requires authentication.
ProxyPortSpecifies the port used by the proxy server that requests are to be routed through.
ProxyTypeThe type of proxy server used for this connection.
ProxyUsernameUsername to be sent on all requests through a proxy server that requires authentication.
RedirectSpecifies whether auto redirection is to take place.
RequestThe request to be sent to the server.
ResponseThe response from the server.
SecuritySets the security level.
TimeoutTimeout in milliseconds for communication commands.
ObjectIsEmptyReturns 1 if object is not created.
LastReturnCodeReturns last known return code from object.
note

Properties ObjectIsEmpty and LastReturnCode are common methods. For more information see Common properties and methods.

Methods

NameDescription
ClearCertificateClears the Certificate set earlier.
CommandSends a command to the server.
GetRetrieves data from the server.
HeadRetrieves header data from the server.
PostSends data to the server for processing.
PutStores data on the server.
SetCertificatePoints out the certificate used to authenticate secure connections.
StartTraceStarts a trace of HTTP communication to file.
StopTraceStops trace of HTTP communication.
CreateObjectCreates a new instance of the object.
FreeObjectReleases 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_NoneNo proxy server. Straight connection.

Value: 0
Proxy_Socks4Uses a SOCKS V4 Proxy.

Value: 1
Proxy_Socks5Uses 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_NoneDo not allow any redirection at all.

Value: 0
HTTPRedirect_AllAllow all redirection.

Value: 1
HTTPRedirect_SameAllow redirection from any source to a similar destination.

Value: 2
HTTPRedirect_ToSecureAllow redirection from a non-secure source to a secure destination.

Value: 4
HTTPRedirect_ToNonSecureAllow 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

HTTP Client Object::Response


Response

The response from the server.

Type:
Default: -
Read: get_Response Write: put_Response

See also

HTTP Client Object::Request


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

CommandType:

Description:

Get

Retrieves data from the server.

Parameters

-

See also

HTTP Client Object::Put


Retrieves header data from the server.

Parameters

-

See also

HTTP Client Object::Get


Post

Sends data to the server for processing.

Parameters

-

See also

HTTP Client Object::Put


Put

Stores data on the server.

Parameters

-

See also

HTTP Client Object::Post


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

CertificateStoreNameType: [CryptStoreNameType]../CommonDataTypes.md#cryptstorenametype)

Description: Name of certificate store.
StoreLocationType:

Description: Location of store.
IssueByType:

Description: Certificate issuer.
SerialNumberType:

Description: Serial number of the certificate.

See also

HTTP Client Object::ClearCertificate


StartTrace

Starts a trace of HTTP communication to file.

Parameters

FilenameType: [ParamTypeFilepath]../CommonDataTypes.md#paramtypefilepath)

Description: Name of file.
TraceSendType: ParamTypeBool

Default: True_Value

Description:
TraceReceiveType: ParamTypeBool

Default: True_Value

Description:
SendPromptType: String

Default: S

Description:
ReceivePromptType: String

Default: R

Description:

See also

HTTP Client Object::StopTrace


StopTrace

Stops trace of HTTP communication.

Parameters

-

See also

HTTP Client Object::StartTrace