util::http::basic_auth (public)

 util::http::basic_auth [ -headers headers ] -username username \
    -password password

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

Builds BASIC authentication header for an HTTP request

Switches:
-headers (optional)
ns_set of request headers that will be populated with auth header. If not specified, a new ns_set will be created. Existing header for BASIC authentication will be overwtitten.
-username (required)
Username for authentication
-password (required)
Password for authentication
Returns:
ns_set of headers containing authentication data

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.
Source code:
    if {$headers eq ""} {
        set headers [ns_set create headers]
    }
    set h "Basic [ns_base64encode ${username}:$password]"
    ns_set idelkey $headers "Authorization"
    ns_set put     $headers "Authorization" $h
    return $headers
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: