|
AAS HTTP Client Documentation
|
Functions | |
| log_response (Response response, int log_level=logging.ERROR) | |
| Extracts and logs error messages from an HTTP response. | |
Variables | |
| _logger | |
| int | STATUS_CODE_200 = 200 |
| int | STATUS_CODE_201 = 201 |
| int | STATUS_CODE_202 = 202 |
| int | STATUS_CODE_204 = 204 |
| int | STATUS_CODE_404 = 404 |
| aas_http_client.utilities.http_helper.log_response | ( | Response | response, |
| int | log_level = logging.ERROR |
||
| ) |
Extracts and logs error messages from an HTTP response.
This method parses the response content for error details, messages, or error fields, and logs each error message found. If the response cannot be decoded as JSON, it logs the raw response content. Always logs the HTTP status code.
| response | The HTTP response object to extract and log errors from |
| log_level | The logging level to use (default is logging.ERROR) |
Definition at line 29 of file http_helper.py.
|
protected |
Definition at line 11 of file http_helper.py.
| int aas_http_client.utilities.http_helper.STATUS_CODE_200 = 200 |
Definition at line 13 of file http_helper.py.
| int aas_http_client.utilities.http_helper.STATUS_CODE_201 = 201 |
Definition at line 14 of file http_helper.py.
| int aas_http_client.utilities.http_helper.STATUS_CODE_202 = 202 |
Definition at line 15 of file http_helper.py.
| int aas_http_client.utilities.http_helper.STATUS_CODE_204 = 204 |
Definition at line 16 of file http_helper.py.
| int aas_http_client.utilities.http_helper.STATUS_CODE_404 = 404 |
Definition at line 17 of file http_helper.py.