www.openlinksw.com
docs.openlinksw.com

Book Home

Contents
Preface

Virtuoso Functions Guide

AMI APIs
Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Geo Spatial
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Phrases
RDF data
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
VAD
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web & Internet
dav add & update fun...
dav lock manipulatio...
dav manipulation fun...
dav search functions
dav_exp
lfs_exp
serv_queue_top
urlrewrite_create_re...
user_key_load
vhost_define
vhost_remove
webdav users & group...
client_attr
connection_get
connection_id
connection_is_dirty
connection_set
connection_vars
connection_vars_set
dbname
dns_txt_get
ftp_get
ftp_ls
ftp_put
get_certificate_info
get_keyword
get_keyword_ucase
http
http_acl_get
http_acl_remove
http_acl_set
http_body_read
http_client
http_client_ext
http_client_ip
http_debug_log
http_enable_gz
http_file
http_flush
http_get
http_header
http_header_get
http_internal_redire...
http_kill
http_listen_host
http_lock
http_map_get
http_map_table
http_param
http_path
http_pending_req
http_physical_path
http_proxy
http_request_get
http_request_header
http_request_header_...
http_request_status
http_rewrite
http_root
http_unlock
http_url
http_value
http_xslt
json_parse
ses_connect
ses_disconnect
ses_read_line
ses_write
tcpip_gethostbyaddr
tcpip_gethostbyname
vsp_calculate_digest
wsdl_import_udt
XML
XPATH & XQUERY

Functions Index

http_request_header

returns array of HTTP request header lines
any http_request_header ([in array any], [in field_name varchar], [in attr-name varchar], [in default_value varchar]);
Description

This function provides access to the HTTP request header lines.

Return Types

If no input parameters are supplied then this function returns a copy of the lines vector of VSP pages. If array, field_name and mime_attribute is supplied then this function will attempt to extract the associated value, if is cannot be found then the default_value input will be returned. If attr-name is supplied then the mime attribute from the field_name will be returned.

Note that when field value is requested then it will be treated as a MIME field and only value will be returned if found. For example consider presence of following header line: "Content-Type: text/plain; charset=utf-8", then if 'Content-Type' is requested, only "text/plain" will be returned. Use http_request_header_full to obtain the full field value.

Examples
Accessing the HTTP request headers
<p>Your request follows</p>
  <?vsp
    declare header any;
    declare ix, len integer;
    declare host varchar;
    header := http_request_header ();
    len := length (header);
    ix := 0;
    while (ix < len)
    {
      http (aref (header, ix));
		  ix := ix + 1;
    }
    host := http_request_header(lines, 'Host', null, '*** NO HOST IN REQUEST ***')
  ?>