xo::REST method expect_status_code (protected)
<instance of xo::REST> expect_status_code r status_codes
Defined in packages/xooauth/tcl/rest-procs.tcl
- Parameters:
- r (required)
- status_codes (required)
- Testcases:
- No testcase defined.
Source code: set status [dict get $r "status"] if {$status ni $status_codes} { set error "" if {[dict exists $r JSON]} { set jsonDict [dict get $r JSON] if {[dict exists $jsonDict error]} { set error ([dict get $jsonDict error]) } } set context "[:uplevel {current methodpath}] [:uplevel {current args}]" set msg "[self] $context: expected status code $status_codes got $status $error" #ns_log notice $msg "\n[ns_set array [dict get $r headers]]" error $msg } if {[dict exists $r JSON]} { return [dict get $r JSON] }XQL Not present: Generic, PostgreSQL, Oracle