Skip to content

Ability to send different headers for every request/api call  #1599

Open
@JohnMusleh

Description

@JohnMusleh

Use case:

I have server A that exposes "api A" to the UI (I develop/control server A)
I have server B that exposes "api B" (I do not develop/control server B)
"api A" calls "api B" and must send the user id in the header when calling "api B"

I use this open api generator in server A to call api B

The problem:

I cannot send user id in the header when calling api B, I thought of changing the global OpenAPI config before every request, this won't work because I can get multiple requests at the same time , a global static object will not work here

Currently the only way to do this is to create a new client instance on every api call, this solution will work but might cause memory issues, especially because I have many client instances

Suggested solution:

if every generated function/api call had an optional header parameter, I would be able send specific header on every call and won't have to create a new client instance

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