Name

http_auth, http_host, http_uri, http_dav_url, http_escape, http_full_request, http_get_string_output, http_strses_memory_size, http_request_status_get, http_request_status_code_get, http_header_array_get, http_current_charset — inspect the current HTTP request state from inside a VSP/VSPX handler

Synopsis

varchar http_auth( );
 
varchar http_host( );
 
varchar http_uri( );
 
varchar http_dav_url( );
 
varchar http_escape( in text varchar,
  in mode integer,
  inout session any,
  in encoding varchar,
  in output_encoding integer);
 
varchar http_full_request( in flags integer);
 
any http_get_string_output( in flags integer);
 
integer http_strses_memory_size( );
 
varchar http_request_status_get( );
 
integer http_request_status_code_get( );
 
any http_header_array_get( );
 
varchar http_current_charset( );
 

Description

These BIFs expose the state of the HTTP request currently being handled. They are intended for use inside a VSP/VSPX or HTTP-mapped procedure; outside an HTTP request context they return SQL NULL or raise an error depending on the BIF.

:  http_auth	the value of the request's Authorization header, NULL if absent.
:  http_host	the value of the Host header, or the listening interface name when no Host is supplied.
:  http_uri	the full request URI (path + query string) as received by the server.
:  http_dav_url	the URL form used by the WebDAV layer (after rewrites and DAV-mount handling).
:  http_escape	escape <text> for safe embedding inside an HTTP message. <mode> selects the rule
:	set (URL component, attribute value, JS string, ...). When <session> is supplied the
:	escaped text is appended to it; otherwise it is returned. Optional <encoding> and
:	<output_encoding> control the input/output charset.
:  http_full_request	returns the full HTTP request as text (status line + headers + body).
:	The bit-flags argument controls what to include.
:  http_get_string_output	returns the current response body buffer as a string_output session.
:	Useful for late post-processing before the response is flushed.
:  http_strses_memory_size	returns the in-memory size of the current response buffer in bytes.
:  http_request_status_get	returns the response status line (e.g. "HTTP/1.1 200 OK") that will be sent.
:  http_request_status_code_get	returns just the numeric status (200, 404, ...).
:  http_header_array_get	returns the current response headers as a vector of (name, value) pairs.
:  http_current_charset	returns the character set name of the current request.
    

© 1992 - OpenLink Software. All rights reserved.

Making Technology Work for You®