util::http::get (public)

 util::http::get [ -url url ] [ -headers headers ] [ -timeout timeout ] \
    [ -max_depth max_depth ] [ -force_ssl ] [ -gzip_response ] \
    [ -spool ] [ -preference preference ]

Defined in packages/acs-tcl/tcl/http-client-procs.tcl

Issue an http GET request to url.

Switches:
-url (optional)
-headers (optional)
specifies an ns_set of extra headers to send to the server when doing the request. Some options exist that allow to avoid the need to specify headers manually, but headers will always take precedence over options.
-timeout (defaults to "30") (optional)
Timeout in seconds. The value can be an integer, a floating point number or an ns_time value.
-max_depth (defaults to "10") (optional)
-force_ssl (boolean) (optional)
specifies wether we want to use SSL despite the url being in http:// form. Default behavior is to use SSL on https:// urls only.
-gzip_response (boolean) (optional)
informs the server that we are capable of receiving gzipped responses. If server complies to our indication, the result will be automatically decompressed.
-spool (boolean) (optional)
enables file spooling of the request on the file specified. It is useful when we expect large responses from the server. The result is spooled to a temporary file, the name is returned in the file component of the result.
-preference (defaults to "native curl") (optional)
decides which available implementation prefer in respective order. Choice is between 'native', based on ns_ api, available for NaviServer only and giving the best performances and 'curl', which wraps the command line utility (available on every system with curl installed).
Returns:
Returns the data as dict with elements headers, page, file, status, and modified.
Source code:
    return [util::http::request  -url             $url  -method          GET  -headers         $headers  -timeout         $timeout  -max_depth       $max_depth  -preference      $preference  -force_ssl=$force_ssl_p  -gzip_response=$gzip_response_p  -spool=$spool_p]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: