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 );


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



HTTP target in form http://<target_host>:<target_port>/<path> (if <target_port> is not given then 80 will be used by default)


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.


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.


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!).


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.


If this parameter is supplied the request will be passed through this HTTP proxy. The format is <proxy_host>:<proxy_port> .


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,

Exception could be also 127.0.0.* i.e. there could have also wildcard.


Table 24.40. Errors signalled by

SQLState Error Code Error Text Description
HT001 Not valid host name or host IP address  
HT002 Target host is unreachable  


Example 24.163. Using http_get()

declare header any;
page := http_get ('');
page := http_get ('',
		header, 'GET', 'If-Modified-Since: Fri, 21 Jul 2000 11:19:45 GMT');
page := http_get ('',
		header, 'POST', '', 'a=1&b=2');
page := http_get ('',
		NULL, 'GET', '', '', '');