canvas::API method request (protected)
<instance of canvas::API> request -method method \ [ -content_type content_type ] [ -token token ] [ -vars vars ] \ -url url
Defined in packages/xooauth/tcl/canvas-procs.tcl
- Switches:
- -method (required)
- -content_type (optional, defaults to
"application/json; charset=utf-8"
)- -token (optional)
- -vars (optional)
- -url (required)
- Testcases:
- No testcase defined.
Source code: if {[string match http* $url]} { # # If we have a full URL, just pass everything up # set result [next] } else { # # We have a relative URL (has to start with a # slash). Prepend "https://graph.microsoft.com" as # prefix. # set tokenArg [expr {[info exists token] ? [list -token $token] : {}}] set result [next [list -method $method -content_type $content_type {*}$tokenArg -vars $vars -url ${:baseurl}/api/${:version}$url]] } #ns_log notice HEADERS=[:pp [ns_set array [dict get $result headers]]] # # handle Canvas pagination (return current/next/first link) # foreach entry [:parse_link_value [ns_set iget [dict get $result headers] link ""]] { ns_log notice "CHECK '$entry'" if {[dict exists $entry params] && [dict exists $entry url]} { foreach param [dict get $entry params] { if {[lindex $param 0] eq "rel"} { dict set result link [lindex $param 1] [dict get $entry url] } } } } return $resultXQL Not present: Generic, PostgreSQL, Oracle