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

Ability to add custom headers to the request #28

Open
sebastianmacias opened this Issue Aug 23, 2018 · 1 comment

Comments

2 participants
@sebastianmacias

sebastianmacias commented Aug 23, 2018

Currently the only header being set is the content type:

/shurcooL/go/ctxhttp/ctxhttp.go:83

req.Header.Set("Content-Type", bodyType)

It would be helpful to allow setting custom headers in addition to the content-type since some graphql servers use headers for auth tokens and setting other variables.

Thanks

@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Sep 8, 2018

Member

It is possible to do this by using a custom HTTP client (that sets custom request headers before delegating to the underlying HTTP client).

See https://github.com/shurcooL/githubv4#authentication for more information. Please let me know if you're satisfied with that solution or if you have any additional questions.

Member

dmitshur commented Sep 8, 2018

It is possible to do this by using a custom HTTP client (that sets custom request headers before delegating to the underlying HTTP client).

See https://github.com/shurcooL/githubv4#authentication for more information. Please let me know if you're satisfied with that solution or if you have any additional questions.

@dmitshur dmitshur added the question label Sep 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment