ds_protocol_http_py_lib.utils.http.request ========================================== .. py:module:: ds_protocol_http_py_lib.utils.http.request .. autoapi-nested-parse:: **File:** ``request.py`` **Region:** ``ds_protocol_http_py_lib/utils/http/request`` Outbound HTTP request copy and param injection. Used by dataset pagination and incremental watermark rules so they never mutate dataset settings in place. Classes ------- .. autoapisummary:: ds_protocol_http_py_lib.utils.http.request.InjectLocation ds_protocol_http_py_lib.utils.http.request.RequestSnapshot Functions --------- .. autoapisummary:: ds_protocol_http_py_lib.utils.http.request.get_header Module Contents --------------- .. py:class:: InjectLocation Bases: :py:obj:`enum.StrEnum` Where a value is written on the request. .. py:attribute:: QUERY :value: 'query' .. py:attribute:: HEADER :value: 'header' .. py:attribute:: BODY :value: 'body' .. py:class:: RequestSnapshot Isolated copy of outbound request fields. .. py:attribute:: url :type: str .. py:attribute:: method :type: Any .. py:attribute:: data :type: Any :value: None .. py:attribute:: json :type: dict[str, Any] | None :value: None .. py:attribute:: params :type: dict[str, Any] | None :value: None .. py:attribute:: headers :type: dict[str, Any] | None :value: None .. py:attribute:: files :type: Any :value: None .. py:method:: clone() -> RequestSnapshot Deep-copy mutable containers. .. py:method:: inject(name: str, value: Any, location: InjectLocation) -> RequestSnapshot Return a clone with ``value`` written at ``location`` under ``name``. ``BODY`` writes ``data`` when that field is non-empty, because ``requests`` ignores ``json`` in that case. Otherwise it writes ``json``. .. py:method:: _inject_body(out: RequestSnapshot, name: str, value: Any) -> RequestSnapshot :staticmethod: Write ``name`` onto the body field ``requests`` will send. .. py:method:: to_request_kwargs() -> dict[str, Any] Keyword arguments for ``connection.request``. .. py:function:: get_header(headers: Any, name: str) -> str | None Case-insensitive header lookup; empty values become ``None``.