Rohttpevent – BrightSign Object Reference Manual (FW 5.1) User Manual

Page 198

Advertising
background image

190

roHttpEvent

This event object is used to handle requests generated by the

roHttpServer

object.


Interfaces:

ifHttpEvent

,

ifUserData


The ifHttpEvent interface provides the following:

GetFailureReason() As String: Yields additional useful information if a function return indicates an error.

GetMethod() As String: Returns the type of HTTP method that triggered the event on the roHttpServer
instance.

SetResponseBodyString(body As String): Sets the response body for an event generated via the
AddGetFromEvent() or AddMethodToString() method on the roHttpServer object. This call is ignored with
any other event.

SetResponseBodyFile(filename As String) As Boolean: Specifies the name of a file to use as the
source response body for an event generated via the

AddGetFromEvent() or AddMethodToString() method

on the roHttpServer object. This call is ignored with any other event. This function will return False if the file cannot
be opened or another failure occurs.

Note: The specified file is read gradually as it is sent to the client.

GetRequestBodyString() As String: Returns the string received if the event was generated via
roHttpServer.AddPostToString(). An empty string is returned with any other event.

GetRequestBodyFile() As String: Returns the name of the temporary file created if the event is generated
via roHttpServer.AddGetFromEvent.This call is ignored with any other event.

GetRequestHeader(header_name As String) As String: Returns the value of the specified HTTP
request header. If the header does not exist, an empty string is returned.

GetRequestHeaders() As Object: Returns an

roAssociativeArray

containing all the HTTP request headers.

GetRequestParam(URI_parameter As String) As String: Returns the value of the specified URI
parameter. If the parameter does not exist, an empty string is returned.

Advertising