Skip to content

Access Request headers set by library before or after sending request #1229

Description

@alexkreidler

I'm writing a library that uses Reqwest and serializes the Request and Response structs to WARC files.

It works great for the Responses, but with Requests it only shows me the headers I've set myself, because I'm using the Request struct before it is passed into the library.

Thus, it doesn't show any library-set headers like User-Agent, I'd guess Accept when the user doesn't set it, and Content-Length (see #1030).

It would be great if we could get access to the Request object as it looks after any library modifications. For my situation, I'm fine getting the Request headers before or after sending request, but I can imagine some folks who would access to it before sending.

I'm not sure if Hyper also sets default headers, in which case this would be more complicated.

Let me know what you think!

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