Skip to main content
Version: 4.2.5

iCore HTTP Server Object

Overview

Implements an HTTP server.

  • HTTP Request Objects and HTTP Response Objects retrieved from get_CurrentRequest and get_CurrentResponse. of an HTTP Server are only valid and usable for the duration of the execution of the Object Event procedure mapped in the object.
  • Private Communications Technology (PTC) is not a supported protocol for iCore HTTP Server Objects.
  • A secure cookie will only be sent over a secure channel (i.e.HTTPS). See also Secure property of Cookie object.

Sections

Init, Main, Procedures, OnExit, and Structure.

note

The object is declared in the Declare section.

Properties

NameDescription
ClientAuthenticationSpecifies if the client is to authenticate after connecting.
MaxIdleTimeIdle time allowed before sessions expire (minutes).
LogDirectoryDirectory for storage of daily log files.
RootDirectoryRoot directory for web pages.
ProtocolSecurity protocol desired for secure connections.
PlaceCookiesControls whether cookies are set.
PutLengthControls whether the Content-Length is inserted in the header.
UseTempWrites all incoming files to the system temporary directory.
RequireCert_TrustedRootRequires that the client certificate is from a Trusted Root Authority (CA).
RequireCert_ValidDateRequires that the client certificate is valid according to its from-to date.
RequireCert_ValidSignatureRequires that the client certificate has a valid signature.
CurrentSessionSession for current HTTP Server event.
CurrentRequestRequest for current HTTP Server event.
CurrentResponseResponse for current HTTP Server event.
CurrentErrorCodeError Code associated with current OnHttpError-event.
CurrentErrorTextError text associated with current OnHttpError-event.
SessionCountNumber of currently active sessions.
SessionReturns the HTTP Session Object at index.
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
SetCertificatePoints out the certificate used to authenticate secure connections.
StartStarts processing of HTTP and HTTPS requests.
ProcessProcesses HTTP and HTTPS requests.
StopStops processing of HTTP and HTTPS requests.
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.

Object events

NameDescription
OnErrorFires whenever an error condition occurs.
OnGetFires when a GET request is received. By default, file information and content (relative to the specified root directory) is sent back to the client. The default response can be modified by placing code within the procedure associated with this event.
OnHeadFires when a HEAD request is received. By default, header information is sent back to the client. The default response can be modified by placing code within the procedure associated with this event.
OnPostFires when a POST request is received. The default response can be modified by placing code within the procedure associated with this event.
OnPutFires when a PUT request is received. The default response can be modified by placing code within the procedure associated with this event.
OnRequestFires when an unknown request is received. This event fires when the request type is not HEAD, GET, POST, or PUT.
OnSessionEndFires before a session is ended. This event fires when Session.IdleTime exceeds the MaxIdleTime property of the Object.
OnSessionInitFires after a new session is created.

The Script procedure associated with an Object Event can fetch the appropriate data from the object through any of the following properties:

See also

Cookie Object
HTTP Client Object
HTTP Header Fields Object
HTTP Request Message Object
HTTP Response Message Object
HTTP Request Object
HTTP Response Object
HTTP Session Object

Properties


ClientAuthentication

Specifies if client is to authenticate after connecting.

Type: ParamTypeBool
Default: False_Value
Read: get_ClientAuthentication
Write: put_ClientAuthentication


MaxIdleTime

Idle time allowed before sessions expire (minutes).

Type:
Default:
Read: get_MaxIdleTime
Write: put_MaxIdleTime


LogDirectory

Directory for storage of daily log files.

Type:
Default:
Read: get_LogDirectory
Write: put_LogDirectory


RootDirectory

Root directory for web pages.

Type:
Default:
Read: get_RootDirectory Write: put_RootDirectory


Protocol

Security protocol for secure connections. For more information, see General information about SSL and TLS.

Type: SecureProtocolType
Default: secprotAuto
Read: get_Protocol
Write: put_Protocol


PlaceCookies

Controls whether cookies are set.

Type: ParamTypeBool
Default: True_value
Read: get_PlaceCookies
Write: put_PlaceCookies


PutLength

Controls whether the Content-Length is inserted in the header.

Type: ParamTypeBool
Default: True_Value
Read: get_PutLength
Write: put_PutLength


UseTemp

Writes all incoming files to the system temporary directory.

Type: ParamTypeBool
Default: True_Value
Read: get_UseTemp
Write: put_UseTemp


RequireCert_TrustedRoot

Requires that the client certificate is from a Trusted Root Authority (CA).

True_Value = Trusted Root Authority is required.

Type: ParamTypeBool
Default: True_Value
Read: get_RequireCert_TrustedRoot
Write: put_RequireCert_TrustedRoot


RequireCert_ValidDate

Requires that the client certificate is valid according to its from-to date.

True_Value = Validity according to from-to date is required.

Type: ParamTypeBool
Default: True_Value
Read: get_RequireCert_ValidDate
Write: put_RequireCert_ValidDate


RequireCert_ValidSignature

Require that the client certificate has a valid signature.

True_Value = Valid signature is required.

Type: ParamTypeBool
Default: True_Value
Read: get_RequireCert_ValidSignature
Write: put_RequireCert_ValidSignature


CurrentSession

Session for current HTTP Server event.

Type:
Default:
Read: get_CurrentSession
Write:


CurrentRequest

Request for current HTTP Server event.

note

HTTP Response and HTTP Request objects retrieved from get_CurrentRequest are only valid and usable for the duration of the execution of the Object Event procedure mapped in the object.

Type:
Default:
Read: get_CurrentRequest
Write:


CurrentResponse

Response for current HTTP Server event.

note

HTTP Response and HTTP Request objects retrieved from get_CurrentResponse are only valid and usable for the duration of the execution of the Object Event procedure mapped in the object.

Type:
Default:
Read: get_CurrentResponse
Write:


CurrentErrorCode

Error Code associated with current OnHttpError-event.

Type:
Default:
Read: get_CurrentErrorCode
Write:

See also

iCore HTTP Server Object::CurrentErrorText


CurrentErrorText

Error text associated with current OnHttpError-event.

Type:
Default:
Read: get_CurrentErrorText
Write:

See also

iCore HTTP Server Object::CurrentErrorCode


SessionCount

Number of currently active sessions.

Type:
Default:
Read: get_SessionCounts
Write:


Session

Returns the Session object at index.

Type:
Default:
Read: get_Session
Write:


Methods


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:

Description: Name of store.
StoreLocationType:

Description: Location of store.
IssueByType:

Description: Certificate issuer.
SerialNumberType:

Description: Serial number of the certificate

Start

Starts processing of HTTP and HTTPS requests.

Parameters

LocalPortType: Integer

Default: 80

Description: Optional Long between -1 and 65535, inclusive. Specifies the non-secure port for accepting connections.Defaults to the well-known HTTP Port 80
LocalSecurePortType: Integer

Default: 443

Description: Optional Long between -1 and 65535, inclusive. Specifies the secure port for accepting connections. Defaults to the well-known HTTPS Port 443.
LocalAddressType: String

Default: ''

Description: Optional String. Interface address to use in dot notation for non-secure communications. Not usually specified.
LocalSecureAddressType: String

Default: ''

Description: Optional String. Interface address to use in dot notation for secure communications. Not usually specified.
BacklogType: Integer

Default. 0

Description: Optional Long. Maximum length to which the queue of pending non-secure connections may grow. Defaults to the maximum number allowed.
SecureBacklogType: Integer

Default: 0

Description: Optional Long. Maximum length to which the queue of pending secure connections may grow. Defaults to the maximum number allowed.

See also

iCore HTTP Server Object::Stop


Process

Processes HTTP and HTTPS requests.

Returns after ProcessTime in milliseconds.

Parameters

ProcessTimeType: Integer

Description: Process time in milliseconds. -1 = infinite processing.
Return valueType: eWaitReturnStatus

Description:

Stop

Stops processing of HTTP and HTTPS requests.

Parameters

---

See also

iCore HTTP Server Object::Start


StartTrace

Starts a trace of HTTP communication to file.

Parameters

FilenameType: ParamTypeFilepath

Default:

Description:
TraceSendType: ParamTypeBool

Default: True_Value

Description:
TraceReceiveType: ParamTypeBool

Default: True_Value

Description:
SendPromptType: String

Default: S<

Description:
ReceivePromptType: String

Default: R>

Description:

See also

iCore HTTP Server Object::StopTrace


StopTrace

Stops trace of HTTP communication.

Parameters

---

See also

iCore HTTP Server Object::Start