|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
Public Member Functions | |
| __init__ (self, base_url, timeout=10.0, headers=None, ssl_context=None) | |
| request (self, path, post=None, fields=None) | |
| request_body (self, path, post, body, content_type="application/json") | |
| get (self, path, post=None, query=None) | |
Public Attributes | |
| base = base_url.rstrip("/") | |
| timeout = timeout | |
| headers = dict(headers or {}) | |
| ssl_context = ssl_context | |
Protected Member Functions | |
| _url (self, path, post, query=None) | |
| _send (self, method, url, body=None, content_type=None) | |
Each request becomes one message posted as ``post`` (the ``PsyPost`` query parameter): query
parameters and form fields become string entries, a JSON/XML/text body a string entry. The reply is
what the responder put in ``JSON``/``XML``/``HTML``/``TEXT``/``BINARY`` (``ResultCode`` = status), or the
whole reply message as JSON.
::
http = PsycloneHttp("http://host:8082")
r = http.request("/ask", "Question", {"Text": "hello"})
print(r.status, r.text)
| psyclone_client.http.PsycloneHttp.__init__ | ( | self, | |
| base_url, | |||
| timeout = 10.0, | |||
| headers = None, | |||
| ssl_context = None ) |
|
protected |
Definition at line 54 of file http.py.
References cmlabs::LLMConnection.headers, psyclone_client.client.Options.headers, headers, psyclone_client.client.Options.ssl_context, ssl_context, cmlabs::ComponentSetup.timeout, cmlabs::TriggerGroupSpec.timeout, cmsdk::ConnectionByteSource< Connection >.timeout, and timeout.
Referenced by get(), request(), and request_body().
|
protected |
Definition at line 44 of file http.py.
References cmlabs::ComponentSetup.base, and base.
Referenced by get(), request(), and request_body().
| psyclone_client.http.PsycloneHttp.get | ( | self, | |
| path, | |||
| post = None, | |||
| query = None ) |
| psyclone_client.http.PsycloneHttp.request | ( | self, | |
| path, | |||
| post = None, | |||
| fields = None ) |
| psyclone_client.http.PsycloneHttp.request_body | ( | self, | |
| path, | |||
| post, | |||
| body, | |||
| content_type = "application/json" ) |
| psyclone_client.http.PsycloneHttp.base = base_url.rstrip("/") |
Definition at line 39 of file http.py.
Referenced by _url(), and test_remote_module.Probe.post().
| psyclone_client.http.PsycloneHttp.headers = dict(headers or {}) |
| psyclone_client.http.PsycloneHttp.ssl_context = ssl_context |
| psyclone_client.http.PsycloneHttp.timeout = timeout |
Definition at line 40 of file http.py.
Referenced by psyclone_client.remote_module.RemoteModule._request_op(), and _send().