www.openlinksw.com
docs.openlinksw.com

Book Home

Contents
Preface

Virtuoso Functions Guide

Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
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
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
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_kill
http_listen_host
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_status
http_rewrite
http_root
http_url
http_value
http_xslt
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_get

returns a varchar containing the body of the request uri
varchar http_get (in target_uri varchar, [out return_header any], [in http_method varchar], [in request_header varchar], [in request_body varchar], [in proxy varchar]);
Description

http_get returns a varchar containing the body of the requested target_uri or NULL if the body is not received.

Parameters
target_uri – HTTP target in form http://<target_host>:<target_port>/<path> (if <target_port> is not given then 80 will be used by default)
return_header – This output parameter is set to the array of HTTP response header lines from the target server, if the parameter is a constant it will be ignored.
http_method – This parameter will be used to specify the HTTP request method. Possible values are: GET, POST, PUT, OPTIONS or see RFC2616[5.1.1] for details.
request_header – This string will be sent to the target server together with other header fields. If more than one header field should be sent then header fields must be separated with CR/LF pair. (Warning: this string must not be terminated with CR/LF pair!).
request_body – This string will be sent to the target server as the request body. The "Content-Length" header field is set to the length of this string.
proxy – If this parameter is supplied the request will be passed through this HTTP proxy. The format is <proxy_host>:<proxy_port> . Supports:
http://[user:pass@]host:port - user & pass are optional
socks4://[user:pass@]host:port - user & pass are optional
socks5://[user:pass@]host:port - user & pass are optional
socks5-host://[user:pass@]host:port - user & pass are optional
In the INI file, in section HTTPServer should be set:
HTTPProxyServer       = proxytest:3128
HTTPProxyExceptions   = localhost:8890, 127.0.0.1:8890
Exception could be also 127.0.0.* i.e. there could have also wildcard.
Errors
SQLState Error Code Error Text Description
HT001 Not valid host name or host IP address
HT002 Target host is unreachable

Examples
Using http_get()
declare header any;
page := http_get ('http://www.openlinksw.com/');
...
page := http_get ('http://www.openlinksw.com/',
		header, 'GET', 'If-Modified-Since: Fri, 21 Jul 2000 11:19:45 GMT');
...
page := http_get ('http://www.openlinksw.com/some_link.html',
		header, 'POST', '', 'a=1&b=2');
...
page := http_get ('http://www.openlinksw.com/',
		NULL, 'GET', '', '', 'proxy.server.com:8080');