coapthon.messages package¶
Submodules¶
coapthon.messages.message module¶
- class coapthon.messages.message.Message[source]¶
Bases: object
Class to handle the Messages.
- acknowledged[source]¶
Checks if is this message has been acknowledged.
Returns: True, if is acknowledged
- add_option(option)[source]¶
Add an option to the message.
Parameters: option (Option) – the option Raises TypeError: if the option is not repeatable and such option is already present in the message
- content_type[source]¶
Get the Content-Type option of a response.
Returns: the Content-Type value or 0 if not specified by the response
- del_option(option)[source]¶
Delete an option from the message
Parameters: option (Option) – the option
- del_option_by_name(name)[source]¶
Delete an option from the message by name
Parameters: name (String) – option name
- del_option_by_number(number)[source]¶
Delete an option from the message by number
Parameters: number (Integer) – option naumber
- etag[source]¶
Get the ETag option of the message.
Return type: list Returns: the ETag values or [] if not specified by the request
- line_print[source]¶
Return the message as a one-line string.
Returns: the string representing the message
- observe[source]¶
Check if the request is an observing request.
Returns: 0, if the request is an observing request
- pretty_print()[source]¶
Return the message as a formatted string.
Returns: the string representing the message
coapthon.messages.option module¶
coapthon.messages.request module¶
- class coapthon.messages.request.Request[source]¶
Bases: coapthon.messages.message.Message
Class to handle the Requests.
- accept[source]¶
Get the Accept option of a request.
Returns: the Accept value or None if not specified by the request :rtype : String
- if_match[source]¶
Get the If-Match option of a request.
Returns: the If-Match values or [] if not specified by the request :rtype : list
- if_none_match[source]¶
Get the if-none-match option of a request.
Returns: True, if if-none-match is present :rtype : bool
- proxy_schema[source]¶
Get the Proxy-Schema option of a request.
Returns: the Proxy-Schema values or None if not specified by the request :rtype : String
coapthon.messages.response module¶
- class coapthon.messages.response.Response[source]¶
Bases: coapthon.messages.message.Message
Class to handle the Responses.
- location_path[source]¶
Return the Location-Path of the response.
:rtype : String :return: the Location-Path option