5.2.4 pse.plugins.response -- information that is returned in the response

content_type
By setting the content_type, you can control the mime type of the output of the servlet. This defaults to 'text/html'.

add_header( header, content)
Add a response header to be sent to the client. header is the header you want to send without the trailing colon (":"), and content is the content of the header. Both header and content must be strings, so if you specify 'Content-Length' as the header, you need to represent the content as a string, even though it is an integer number. The same header can be added multiple times, in which case multiple headers will be sent.

Calling this function after pse.flush has been called will raise a HeadersSentError.

authenticate( [realm = 'PSE Application'])
The authenticate function can be called to immediately deny access and call for Basic authentication from the client, without further processing of the servlet. The realm argument can be used to specify different authentication realms for different servlets in the application.

Calling this function after pse.flush has been called will raise a HeadersSentError.

New in version 3.0.

redirect( url[, method = pse.plugins.response.MOVED_TEMPORARILY])
Immediatly quit running the servlet and redirect to a new URL. The value of url must be a valid URL, either internal or external, to redirect the browser.

The value of method must be one of MOVED_TEMPORARILY, MOVED_PERMANENTLY, SEE_ALSO, TEMPORARY_REDIRECT or REFRESH. The first four correspond to HTTP results codes; normally this should be MOVED_TEMPORARILY, but your needs may require a different response. The REFRESH method differs in that it inserts a Refresh header in the response to refresh the page location, with a delay of 0 seconds.

Calling this function after pse.flush has been called will raise a HeadersSentError.

Changed in version 3.0.