spresso.model.web package¶
Submodules¶
spresso.model.web.base module¶
-
class
Request
[source]¶ Bases:
object
Base class defining the interface of a request.
Retrieve a list of cookies from the header of the request.
Retrieve a specific cookie from the header of the request.
-
method
¶ Returns the HTTP method of the request.
-
path
¶ Returns the current path portion of the current uri. Used by some grants to determine which action to take.
-
class
Response
[source]¶ Bases:
object
Contains data returned to the requesting user agent.
Add a cookie to the response.
Parameters: - key (str) – The identifier.
- value (str) – The value.
- expires (str) – The expiration date.
- path (str) – The path.
- comment (str) – A comment.
- domain (str) – The domain.
- max_age (str) – The expiration time in seconds.
- secure (bool) – Secure flag.
- version (str) – The version.
- http_only (bool) – HTTPOnly flag.
spresso.model.web.wsgi module¶
-
class
WsgiRequest
(env)[source]¶ Bases:
spresso.model.web.base.Request
Contains data of the current HTTP request.
Returns all cookies of the request.
Returns: An empty dictionary or all dictionary containing all cookies.
Returns a specific cookie of the request.
Returns: None or the cookie value.
-
get_param
(name, default=None)[source]¶ Returns a param of a GET request identified by its name.
Returns: A default value or the parameter.