Skip to content

Custom Headers option #10

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

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open

Custom Headers option #10

wants to merge 27 commits into from

Conversation

alaptseu
Copy link

No description provided.

schickling and others added 27 commits May 12, 2016 14:09
urllib2 doesn't exist within python3. The proposed changes should be compatible with python2 and 3, tested on 2.7.13 and 3.6.0.
OK this works in python 2 and python 3.

However in python 2 it returns a unicode type and in python 3 a string class. It is also dependent on six.moves, so a dependency for six will need to be added. Using six is the easiest way to deal with urllib2 changes form Python2 to Python3. I can use the requests library if you guys prefer.

I tested this against my own Gcool endpoint. These IDs will be deleted so I don't mind them in the public view.

Python 3 returned:
{"data":{"allDevices":[{"id":"cj65hnfrr34u00135z8l3glfq"},{"id":"cj65jm5kr3n6101350sfhk58t"},{"id":"cj65mdwpx0art0152rydd3yzy"},{"id":"cj65mg1sy0aum01529ro6x9h6"},{"id":"cj65mg6s30aut0152irb5j1th"}]}}

The type is <class 'str'>

Python 2 returned:
{"data":{"allDevices":[{"id":"cj65hnfrr34u00135z8l3glfq"},{"id":"cj65jm5kr3n6101350sfhk58t"},{"id":"cj65mdwpx0art0152rydd3yzy"},{"id":"cj65mg1sy0aum01529ro6x9h6"},{"id":"cj65mg6s30aut0152irb5j1th"}]}}

The type is <type 'unicode'>
User should be able to compose their own authorization header.
For example AWS API Gateway using Cognito User Pool can not check Authorization header token which has Bearer
fix: Remove Bearer from Authorization header
Add inject_token example to README
Increment version, add long description, and edit author
Also add language to previous code block for syntax highlighting on GH.
Allow the authorization header name to vary
palantir0 pushed a commit to palantir0/python-graphql-client that referenced this pull request Jan 26, 2020
…lient into alaptseu-master

Resolve minor conflicts with updates from alaptseu PR prisma-labs#10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants