You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When trying to download a file in chunks, I need to be able to specify the Range header. There is currently no way of specifying any additional headers outside of the call to the provided client's get_headers()
Describe the solution you'd like
There are two ways of going about this, and I feel both have their uses:
Specify custom headers when creating a Client to be used with endpoint functions. This is useful in cases where a header needs to be used/reused frequently. The only downside is this is a bit inconvenient in use cases where the headers aren't used/reused frequently. There could be a set_headers method or something similar, but the easiest way to handle single-use headers would be:
Add a headers: Optional[Dict[str, Any]] param to endpoint functions. This allows headers to be specified on a per-call basis such that using something like the Range header wouldn't require creating a new Client (or updating an existing Client's headers) for each call
I think implementing both would be best. It gives the flexibility of per-call headers, while also allowing users to have clients with a pre-set (albeit updatable) set of headers for easy reuse
The text was updated successfully, but these errors were encountered:
@emannguitar there is a way in OpenAPI to declare header parameters. Is the param both declared in the server side and being populated to the document? If so we should just implement #117
Is your feature request related to a problem? Please describe.
When trying to download a file in chunks, I need to be able to specify the
Range
header. There is currently no way of specifying any additional headers outside of the call to the provided client'sget_headers()
Describe the solution you'd like
There are two ways of going about this, and I feel both have their uses:
Client
to be used with endpoint functions. This is useful in cases where a header needs to be used/reused frequently. The only downside is this is a bit inconvenient in use cases where the headers aren't used/reused frequently. There could be aset_headers
method or something similar, but the easiest way to handle single-use headers would be:headers: Optional[Dict[str, Any]]
param to endpoint functions. This allows headers to be specified on a per-call basis such that using something like theRange
header wouldn't require creating a newClient
(or updating an existing Client's headers) for each callI think implementing both would be best. It gives the flexibility of per-call headers, while also allowing users to have clients with a pre-set (albeit updatable) set of headers for easy reuse
The text was updated successfully, but these errors were encountered: