session:response_status_set_std

March 26, 2020

Name

session:response_status_set_std — Set the HTTP status for the session response

Synopsis

session:response_status_set_std(cod, message, mimetype);

code: numeric
message: string
mimetype: string (optional)

Description

Use this function with msys.httpsrv.register to set the HTTP status for the session response. For example code see “msys.httpsrv.register Example”. For a description of the session object, see ec_httpsrv_session.

Set the code to a valid HTTP response code, the message to an appropriate message, and mimetype to a mime type. The following is an example:

session:response_status_set_std(200, response, "text/plain");

Enable this function with the statement require("msys.extended.httpsrv");.

See Also

msys.httpsrv.register and session:request_url_get