wotpy.protocols.http.client

Classes that contain the client logic for the HTTP protocol.

Classes

HTTPClient([connect_timeout, request_timeout])

Implementation of the protocol client interface for the HTTP protocol.

class wotpy.protocols.http.client.HTTPClient(connect_timeout=60, request_timeout=60)

Bases: BaseProtocolClient

Implementation of the protocol client interface for the HTTP protocol.

DEFAULT_CON_TIMEOUT = 60
DEFAULT_REQ_TIMEOUT = 60
JSON_HEADERS = {'Content-Type': 'application/json'}
property connect_timeout

Returns the default connection timeout for all HTTP requests.

async invoke_action(td, name, input_value, timeout=None)

Invokes an Action on a remote Thing. Returns a Future.

is_supported_interaction(td, name)

Returns True if the any of the Forms for the Interaction with the given name is supported in this Protocol Binding client.

on_event(td, name)

Subscribes to an event on a remote Thing. Returns an Observable.

on_property_change(td, name)

Subscribes to property changes on a remote Thing. Returns an Observable

on_td_change(url)

Subscribes to Thing Description changes on a remote Thing. Returns an Observable.

classmethod pick_http_href(td, forms, op=None)

Picks the most appropriate HTTP form href from the given list of forms.

property protocol

Protocol of this client instance. A member of the Protocols enum.

async read_property(td, name, timeout=None)

Reads the value of a Property on a remote Thing. Returns a Future.

property request_timeout

Returns the default request timeout for all HTTP requests.

set_security(security_scheme_dict, credentials)

Sets the security credentials for the given security scheme.

async sign_request(request)

Adds the appropriate authorization header to the request and delegates the addition of the header to the credential class.

async write_property(td, name, value, timeout=None)

Updates the value of a Property on a remote Thing. Returns a Future.