util::http::available (public)

 util::http::available [ -preference preference ] [ args... ]

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

Return the preferred HTTP API among those available based on preference and OpenACS installation capabilities.

Switches:
-preference (optional, defaults to "native curl")
decides which available implementation prefer in respective order. Choice is between 'native', based on ns_http 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).

Partial Call Graph (max 5 caller/called nodes):
%3 util::http::request util::http::request (private) util::http::available util::http::available util::http::request->util::http::available acs::icanuse acs::icanuse (public) util::http::available->acs::icanuse util::which util::which (public) util::http::available->util::which

Testcases:
No testcase defined.
Source code:
    if {[llength $args] > 0} {
        ns_log warning "util::http::available: possible deprecated arguments specified ($args)"
    }

    set preferred [lindex $preference 0]

    if {$preferred eq "native" && [acs::icanuse "ns_http results dict"]} {
        return "native"
    } elseif {[util::which curl] ne ""} {
        return "curl"
    } else {
        return ""
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: