- Publicity: Public Only All
rest-procs.tcl
Support for some REST APIs
This file defines the following Objects and Classes: ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST, ::xo::REST
- Location:
- packages/xooauth/tcl/rest-procs.tcl
- Author:
- Gustaf Neumann
Procedures in this file
- Class ::xo::REST (public)
- xo::REST instproc body (protected)
- xo::REST instproc expect_status_code (protected)
- xo::REST instproc init (protected)
- xo::REST instproc json_to_dict (protected)
- xo::REST instproc pp (public)
- xo::REST instproc request (protected)
- xo::REST instproc typed_list_to_json (protected)
- xo::REST instproc typed_value_to_json (protected)
- xo::REST instproc with_json_result (protected)
Detailed information
Class ::xo::REST (public)
::nx::Class ::xo::REST
The client_id/client_secret identifies the registered "app" for which later app-tokens are used to issue action via the REST interface.
- Testcases:
- No testcase defined.
xo::REST method body (protected)
<instance of xo::REST> body [ -content_type content_type ] \ [ -vars vars ]
Build a body based on the provided variable names. The values are retrieved via uplevel calls.
- Switches:
- -content_type (optional, defaults to
"application/json; charset=utf-8"
)- -vars (optional)
- Testcases:
- No testcase defined.
xo::REST method expect_status_code (protected)
<instance of xo::REST> expect_status_code r status_codes
- Parameters:
- r (required)
- status_codes (required)
- Testcases:
- No testcase defined.
xo::REST method init (protected)
<instance of xo::REST> init
Make sure, we have the nsv array for application tokens defined.
- Testcases:
- No testcase defined.
xo::REST method json_to_dict (protected)
<instance of xo::REST> json_to_dict json_string
Convert JSON to a Tcl dict and add it to the result dict.
- Parameters:
- json_string (required)
- Testcases:
- No testcase defined.
xo::REST method pp (public)
<instance of xo::REST> pp [ -list ] [ -prefix prefix ] dict
Simple pretty-print function which is based on the conventions of the dict structures as returned from Microsoft Graph API. Multi-valued results are returned in a dict member named "value", which are printed indented and space separated.
- Switches:
- -list (optional)
- -prefix (optional)
- Parameters:
- dict (required)
- Testcases:
- No testcase defined.
xo::REST method request (protected)
<instance of xo::REST> request -method method \ [ -content_type content_type ] [ -token token ] [ -vars vars ] \ -url url
- Switches:
- -method (required)
- -content_type (optional, defaults to
"application/json; charset=utf-8"
)- -token (optional)
- -vars (optional)
- -url (required)
- Testcases:
- No testcase defined.
xo::REST method typed_list_to_json (protected)
<instance of xo::REST> typed_list_to_json triples
Convert a list of triples (name, type, value) into json/bson notation. In case, there is mongodb support, use it, otherwise use a simple approximation. The "type" element of the triple is used to determine value formatting, such as e.g. quoting.
- Parameters:
- triples (required)
- Testcases:
- No testcase defined.
xo::REST method typed_value_to_json (protected)
<instance of xo::REST> typed_value_to_json type value
- Parameters:
- type (required)
- value (required)
- Testcases:
- No testcase defined.
xo::REST method with_json_result (protected)
<instance of xo::REST> with_json_result rvar
- Parameters:
- rvar (required)
- Testcases:
- No testcase defined.