Skip to content

Add headers to the object and pass it to childs #24

@kajbaf

Description

@kajbaf

It would be useful to pass base headers to the URL object and cache it.

Then, any child URLs can inherit this top-level header values.

Any call to HTTP verbs can amend or override cached headers.

root = Path(base_url, headers={"accept": "application/json"}

# get data as json
root.get()

# post data as json
content = root / "content"
content.post(params={"a": "b"}, headers={"content-type": "application/json"})

I'll try to create a patch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions