magpie.owsrequest

The OWSRequest is based on pywps code:

Attributes

LOGGER

Classes

OWSParser

OWSGetParser

Basically a case-insensitive query string parser.

OWSPostParser

MultiFormatParser

Functions

ows_parser_factory(→ OWSParser)

Retrieve the appropriate OWSParser parser using the Content-Type header.

Module Contents

magpie.owsrequest.LOGGER[source]
magpie.owsrequest.ows_parser_factory(request: pyramid.request.Request) OWSParser[source]

Retrieve the appropriate OWSParser parser using the Content-Type header.

If the Content-Type header is missing or text/plain, and the request has a body, try to parse the body as JSON and set the content-type to application/json if successful.

Handle XML-like Content-Type headers such as application/x-www-form-urlencoded whenever applicable.

Otherwise, use the basic OWSGetParser or OWSPostParser according to the presence of a body. These provide minimal parsing to handle most typical OGC Web Services (OWS) request parameters.

class magpie.owsrequest.OWSParser(request)[source]

Bases: object

request[source]
params[source]
parse(param_list)[source]

Parses the initialized request to populate params retrieved from the parser.

Once this method has been called, all expected parameters are guaranteed to exist within :attr`params`. Missing query parameters from the request will be set to None. All query parameter names will be normalized to lower characters for easier retrieval.

Parameters:

param_list – all known query parameters to the service.

abstract _get_param_value(param)[source]
class magpie.owsrequest.OWSGetParser(request)[source]

Bases: OWSParser

Basically a case-insensitive query string parser.

_params[source]
_request_params()[source]
_get_param_value(param)[source]
class magpie.owsrequest.OWSPostParser(request)[source]

Bases: OWSParser

document[source]
_get_param_value(param)[source]
class magpie.owsrequest.MultiFormatParser(request)[source]

Bases: OWSParser

_get_param_value(param)[source]