Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Default headers for clients #32

Open
marfarma opened this issue Apr 25, 2014 · 3 comments
Open

Default headers for clients #32

marfarma opened this issue Apr 25, 2014 · 3 comments
Milestone

Comments

@marfarma
Copy link

My API requires custom headers, for a use case similar to this scenario:

Where I've seen custom headers com up is in a system to system request operating on behalf of a user. The proxy system will validate the user and add "X-User: userid" to the headers and use the system credentials to hit the endpoint. The receiving system validates that the system credentials are authorized to act on behalf of the user, then validate that the user is authorized to perform the action. http://stackoverflow.com/a/9169270/149060

I was concerned that I didn't see support for them in the todo list.

@pksunkara
Copy link
Owner

How do you think the client library should behave in this?

You can send headers when making an API call using the client. Wouldn't that solve this issue?

@pksunkara
Copy link
Owner

@marfarma Could you describe this case more? Do you want the api clients to have some default headers?

@marfarma
Copy link
Author

Yes, exactly that. In my case the API is to a service that implements a facade against another API. Attributes required to connect to that API must exist in each request against mine. Rather than pollute every request payload, I expect a header with those values.

My thoughts were that I should be able to define required connection constants, and associated header formatting, encoding, etc. The values would be assigned once per connection instance of the client library. The library then builds the required headers and inserts them on each request.

@pksunkara pksunkara added this to the 1.1.0 milestone Aug 21, 2014
@pksunkara pksunkara changed the title Eventual custom header support Default headers for clients Feb 21, 2015
@pksunkara pksunkara modified the milestones: 1.1.0, 1.0.0 Feb 21, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants