The HTTPServiceRequest class / com.HTTPServiceRequest methods |
Sends and HTTP response with data of a BYTE variable.
sendDataResponse( code INTEGER, desc STRING, data BYTE )
The sendDataResponse() method performs the HTTP response by sending the a status (code) and description (desc), followed by the headers previously set, and binary data contained in the BYTE program variable as body.
The BYTE must be located in memory and not NULL otherwise operation fails.
If the request failed to be read, its content will be discarded; for example, when a request is not well formatted.
The default Content-Type header is application/octet-stream, but it can be changed to any other mime type. For example: image/jpeg.
In HTTP 1.1, if the body size is greater than 32k, the response will be sent in several chunks of the same size.
If the description is NULL, a default description according to the status code is sent.
The body of the request is discarded.
New incoming requests can be retrieved again with the com.WebServiceEngine.GetHTTPServiceRequest() method.
In case of error, the method throws an exception and sets the STATUS variable with the appropriate error number.