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 one to avoid the need to specify headers manually, but headers will always take precedence over options.
-timeout (optional, defaults to "30")
Timeout in seconds. The value can be an integer, a floating point number or an ns_time value.
-max_depth (optional, defaults to "10")
-force_ssl (optional, boolean)
specifies whether we want to use SSL despite the url being in http:// form. Default behavior is to use SSL on https:// URLs only.
-gzip_response (optional, boolean)
informs the server that we are capable of receiving gzipped responses. If server complies to our indication, the result will be automatically decompressed.
-spool (optional, boolean)
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 (optional, defaults to "native curl")
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:
the data as dict with elements 'headers', 'page', 'file', 'status', 'time' (elapsed request time in ns_time format), and 'modified'.

Partial Call Graph (max 5 caller/called nodes):
%3 test_postman_echo postman_echo (test acs-tcl) util::http::get util::http::get test_postman_echo->util::http::get test_util_http_json_encoding util_http_json_encoding (test acs-tcl) test_util_http_json_encoding->util::http::get util::http::request util::http::request (private) util::http::get->util::http::request apidoc::get_doc_url apidoc::get_doc_url (private) apidoc::get_doc_url->util::http::get apm_get_package_repository apm_get_package_repository (public) apm_get_package_repository->util::http::get apm_get_repository_channels apm_get_repository_channels (public) apm_get_repository_channels->util::http::get apm_transfer_file apm_transfer_file (private) apm_transfer_file->util::http::get auth::sync::get_doc::http::GetDocument auth::sync::get_doc::http::GetDocument (private) auth::sync::get_doc::http::GetDocument->util::http::get

Testcases:
util_http_json_encoding, postman_echo
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: