coapy.resource

copyright:Copyright 2013, Peter A. Bigot
license:Apache-2.0
class coapy.resource.LinkValue(target_uri, params)[source]
params[source]

The map from parameter names to tokens.

target_uri[source]

The URI-reference that is the target URI.

Express link value as RFC 6690 link-value.

The target_uri is wrapped in angle brackets. Parameters are converted to text key=value elements, where value is enclosed in double quotes if necessary. All values are combined to a string using semicolon separators, and that string returned to the caller.

Where value is None, only key is included.

Where value includes double quote characters ("), the quoted value escapes them with a single backslash for the purposes of parsing the resulting string: thus if k has value one"two, the generated parameter will be k="one\"two". This done solely to avoid syntax errors on parsing; there is no corresponding conversion of \" sequences to double-quote characters when the string representation is processed by from_link_format(), and the semantics of escaped characters within a parameter value is the province of the specific parameter.

No attempt is (currently) made to implement the requirements of RFC 2231.

Previous topic

coapy.endpoint

Next topic

coapy.util

This Page