-
Notifications
You must be signed in to change notification settings - Fork 184
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
Add a request option for custom headers #118
Conversation
87cb3f5
to
e4e8148
Compare
e4e8148
to
f3f9600
Compare
A Typescript user will get a compile-time error right away, but we likely have a lot of non-Typescript users so I think it's worth throwing an error. Probably we should do a more informative one. I'd probably do an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just one more comment, and add a changeset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just add a changeset.
Allow users to pass custom request headers through request options.
Questions:
customHeaders
object that isn't aHeader
(e.g.customHeaders: { headerName: 'headerValue'}
, rather thancustomHeaders: new Headers({ headerName: 'headerValue' })
), should we a) raise aTypeError: url.requestOptions.customHeaders.entries is not a function
, or b) Ignore the custom headers?apiClient
andcustomHeaders
fields. Should these checks be added to this PR, or a separate one?