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
Name | Description |
---|---|
ClientAuthentication | Specifies if the client is to authenticate after connecting. |
MaxIdleTime | Idle time allowed before sessions expire (minutes). |
LogDirectory | Directory for storage of daily log files. |
RootDirectory | Root directory for web pages. |
Protocol | Security protocol desired for secure connections. |
PlaceCookies | Controls whether cookies are set. |
PutLength | Controls whether the Content-Length is inserted in the header. |
UseTemp | Writes all incoming files to the system temporary directory. |
RequireCert_TrustedRoot | Requires that the client certificate is from a Trusted Root Authority (CA). |
RequireCert_ValidDate | Requires that the client certificate is valid according to its from-to date. |
RequireCert_ValidSignature | Requires that the client certificate has a valid signature. |
CurrentSession | Session for current HTTP Server event. |
CurrentRequest | Request for current HTTP Server event. |
CurrentResponse | Response for current HTTP Server event. |
CurrentErrorCode | Error Code associated with current OnHttpError-event. |
CurrentErrorText | Error text associated with current OnHttpError-event. |
SessionCount | Number of currently active sessions. |
Session | Returns the HTTP Session Object at index. |
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 |
SetCertificate | Points out the certificate used to authenticate secure connections. |
Start | Starts processing of HTTP and HTTPS requests. |
Process | Processes HTTP and HTTPS requests. |
Stop | Stops processing of HTTP and HTTPS requests. |
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.
Object events
Name | Description |
OnError | Fires whenever an error condition occurs. |
OnGet | Fires 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. |
OnHead | Fires 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. |
OnPost | Fires when a POST request is received. The default response can be modified by placing code within the procedure associated with this event. |
OnPut | Fires when a PUT request is received. The default response can be modified by placing code within the procedure associated with this event. |
OnRequest | Fires when an unknown request is received. This event fires when the request type is not HEAD, GET, POST, or PUT. |
OnSessionEnd | Fires before a session is ended. This event fires when Session.IdleTime exceeds the MaxIdleTime property of the Object. |
OnSessionInit | Fires 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
CertificateStoreName | Type: Description: Name of store. |
StoreLocation | Type: Description: Location of store. |
IssueBy | Type: Description: Certificate issuer. |
SerialNumber | Type: Description: Serial number of the certificate |
Start
Starts processing of HTTP and HTTPS requests.
Parameters
LocalPort | Type: 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 |
LocalSecurePort | Type: 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. |
LocalAddress | Type: String Default: '' Description: Optional String. Interface address to use in dot notation for non-secure communications. Not usually specified. |
LocalSecureAddress | Type: String Default: '' Description: Optional String. Interface address to use in dot notation for secure communications. Not usually specified. |
Backlog | Type: 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. |
SecureBacklog | Type: 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
ProcessTime | Type: Integer Description: Process time in milliseconds. -1 = infinite processing. |
Return value | Type: 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
Filename | Type: ParamTypeFilepath Default: Description: |
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
iCore HTTP Server Object::StopTrace
StopTrace
Stops trace of HTTP communication.
Parameters
---
See also
iCore HTTP Server Object::Start