MoneyWorks Manual
PutHTTPRequestResponse(httpCode, [mimetype_or_headers], [payloadPath] )
Result type: none
Definition: In an HTTP handler in MoneyWorks Gold, you can use this function to set the HTTP response code, and headers. You can pass either a mimetype for the response which will be converted to a Content-Type header, or you can pass multiple entire headers separated by CRLF. If you supply a payload path, the file will be read and the contents will be transmitted as the response instead of the handler's return value.
In an HTTP handler running in the CLI on Datacentre, you cannot set the http code (that parameter is ignored), and you may only pass a mimetype. You cannot set other headers. You can pass a path to a response payload file. If you do not pass a path, the response payload is the return value of the handler.
See Also:
GetHTTPRequest: Get the HTTP request when processing a REST request on the server
GetHTTPRequestHeaders: Get the HTTP request headers when processing a REST request on the server
GetHTTPRequestPayload: Get the POST payload of an HTTP or REST request
GetHTTPServerPort: Get port of an HTTP server
SSE_Send: Push SSE data to an HTTP client
StartHTTPServer: Start an HTTP server
StopHTTPServer: Stop an HTTP server