CGI Operations
http_get_request
Returns query parameters from a GET request. The result is formed as a structure, with parameter names as field names. If there is more than one parameter with the same name, a list is formed. This instruction takes no arguments.
http_post_request
Similar to http_get_request, only for POST requests. Works with url-encoded and multipart forms.
If the request contains a multipart form with file fields, the result structure will contain additional fields for each file field: <fieldname>_contenttype with the content type of the file; <fieldname>_filename with the name of the file; <fieldname>_filesize with the size of the file.
Arguments:
- :encoding
- When parsing multipart forms, this argument can be used to specify the encoding of non-file fields. If this argument is omitted, all fields will be treated as binary data.
http_response
Writes HTTP headers (and data).
Arguments:
- :redirect
- If this argument is given, no data is written, only an HTTP entry, that instructs the browser to redirect to this location.
- :cache
- Instructs that the response will expire in the given number of hours. This argument is optional.
- :type
- Content type of the response. If this argument is omitted, text/html is used.
- :filename
- If this argument is given, the response will be formed as an attachment, using this file name.
- :encoding
- If this parameter is given, the data will be encoded using this encoding. In other case, data will be written without any transformation.
- :data*
- Content of the response.