minos.networks.rest.requests module¶
- class minos.networks.rest.requests.RestRequest(raw, *args, **kwargs)[source]¶
Bases:
minos.networks.requests.abc.RequestRest Request class.
- async content(**kwargs)¶
Get the request content.
- Parameters
kwargs – Additional named arguments.
- Return type
typing.Any- Returns
The request content.
- property content_type: str¶
Get the content type.
- Return type
str- Returns
A
strvalue.
- property has_content: bool¶
Check if the request has content.
- Return type
bool- Returns
Trueif it has content orFalseotherwise.
- property has_params: bool¶
Check if the request has params.
- Return type
bool- Returns
Trueif it has params orFalseotherwise.
- property has_query_params: bool¶
Check if the request has query params.
- Return type
bool- Returns
Trueif it has query params orFalseotherwise.
- property has_url_params: bool¶
Check if the request has url params.
- Return type
bool- Returns
Trueif it has url params orFalseotherwise.
- property headers: dict[str, str]¶
Get the headers of the request.
- Return type
dict[str,str]- Returns
A dictionary in which keys are
strinstances and values arestrinstances.
- async params(**kwargs)¶
Get the request params.
- Parameters
kwargs – Additional named arguments.
- Return type
dict[str,typing.Any]- Returns
The request params.
- async query_params(type_=None, **kwargs)[source]¶
Get the query params.
- Parameters
type – Optional
typeorstr(classname) that defines the request content type.kwargs – Additional named arguments.
- Return type
typing.Any- Returns
A dictionary instance.
- raw¶
- property raw_request: aiohttp.web_request.Request¶
Get the raw request within the instance.
- Return type
aiohttp.web_request.Request- Returns
An
aiohttp.web.Requestinstance.
- async url_params(type_=None, **kwargs)[source]¶
Get the url params.
- Parameters
type – Optional
typeorstr(classname) that defines the request content type.kwargs – Additional named arguments.
- Return type
typing.Any- Returns
A dictionary instance.
- user¶
Returns the UUID of the user making the Request.
- class minos.networks.rest.requests.RestResponse(data)[source]¶
Bases:
minos.networks.requests.abc.ResponseRest Response class.
- __init__(data)¶
- async content(**kwargs)¶
Response content.
- Parameters
kwargs – Additional named arguments.
- Return type
typing.Any- Returns
A list of items.
- async raw_content(**kwargs)¶
Raw response content.
- Parameters
kwargs – Additional named arguments.
- Return type
typing.Any- Returns
A list of raw items.