Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQ] [rust-reqwest-blocking] Return response headers when present in the response definition #16111

Open
nponsard opened this issue Jul 17, 2023 · 0 comments

Comments

@nponsard
Copy link

Is your feature request related to a problem? Please describe.

I have an API that returns no body and a location header linking to the newly created resource. The header is documented in the openapi specification file.
I would like to be able to get this header in the value returned by the generated function.

Describe the solution you'd like

The documented headers would be returned in a struct like a parsed body would.

Describe alternatives you've considered

Manually editing the code to read the header, but that would be needed every time we want to update the API.

Additional context

The definition looks like this

    post:
      responses:
        "201":
          headers:
            location:
              description: Where to find the newly added object.
              schema:
                type: string
          description: |
            Successful importation of the object
            e.g. "https://localhost/v1/obj/<random-id>".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant