Features
This section describes all features that are shipped with this package.
Scenario Features
Client Scenario Features
- class balderhub.http.lib.scenario_features.client.WebSessionFeature(**kwargs: Feature)
Bases:
FeatureBasic feature to work with web sessions.
- get_last_response() Response | None
- Returns:
returns the last response that was made over this session
- request(method: str | HttpMethod, url: str | Url, data: dict | bytes | None = None, headers: dict[str, str] | None = None, cookies: dict[str, str] | None = None, **kwargs) Response
This method allows to execute a request. It returns a new response object.
- Parameters:
method – the http method to use
url – the url the request should be made to
data – optional the data that should be append into the body of the request
headers – the headers that the request should include
cookies – the cookies that the request should include
- Returns:
a response object that holds status code and the answer from the resource
Server Scenario Features
Note
This package does not provide any server scenario features yet.
Setup Features
Client Setup Features
The following section holds client setup features that provides implementation for clients like browsers or command line tools.
- class balderhub.http.lib.setup_features.client.WebSessionWithRequestsFeature(**kwargs)
Bases:
WebSessionFeatureThis setup feature provides an implementation for working with web session by using the python-requests library.
- request(method: str | HttpMethod, url: str | Url, data: dict | bytes | None = None, headers: dict[str, str] | None = None, cookies: dict[str, str] | None = None, **kwargs) Response
This method allows to execute a request. It returns a new response object.
- Parameters:
method – the http method to use
url – the url the request should be made to
data – optional the data that should be append into the body of the request
headers – the headers that the request should include
cookies – the cookies that the request should include
- Returns:
a response object that holds status code and the answer from the resource
Server Setup Features
This section holds server setup features that provides implementation for http servers or further developed servers that are using the http protocol.
Note
This package does not provide any server setup features yet.