lanraragi_api.util package

Submodules

lanraragi_api.util.http module

lanraragi_api.util.http.merge_headers(old_headers: dict[str, Any] | None = None, new_headers: dict[str, Any] | None = None) → dict[str, Any]

Merge the new headers into the old headers.

New headers wine over old headers of the same name.

Parameters:
  • old_headers – default headers. Defaults to None, which will be an empty dict.

  • new_headers – new headers. Defaults to None, which will be an empty dict.

Returns:

Headers merged, defaults included.

Return type:

dict

lanraragi_api.util.http.merge_params(old_params: dict[str, Any] | None = None, new_params: dict[str, Any] | None = None) → dict[str, Any]

Merge the new query parameters into the old query parameters.

New query parameters wine over old query parameters of the same name.

Parameters:
  • old_params – default query parameters. Defaults to None, which will be an empty dict.

  • new_params – new query parameters. Defaults to None, which will be an empty dict.

Returns:

query parameters merged, defaults included.

Return type:

dict

lanraragi_api.util.http.normalize_params(params: dict[str, Any]) → dict[str, Any]

Normalize query parameters by overriding the default marshalling of some types to fit the HTTP standard.

Module contents