Python Requests Authentication Examples - Basic Auth, Custom Headers w/ Code
Вставка
- Опубліковано 11 лип 2021
- We'll talk about basic authentication and how to use custom headers for tokens in this video with a couple of examples. Want a specific example of the service you're using? Let me know!
Video on getting started with requests:
• Python Requests Librar...
** Want to clone this script? **
wayscript.com/script/m1Fbl9xt
Questions about this script or anything else? Join our discord. We're always around to help.
/ discord
wayscript.com/
Follow WayScript on Social Media:
GitHub - github.com/wayscript
Twitter - / wayscripthq
Linkedin - / wayscript
Instagram - / wayscript
Facebook - / wayscript
#WayScript gives you flexible building blocks to seamlessly integrate, automate, and host tools in the cloud. Unlock new potential with drag and drop programming.
Need ideas on how to use WayScript? View our template library to get ideas:
wayscript.com/community
Ready to get started? Get Superpowers with WayScript today. - Наука та технологія
Newbie on API world, reading documentation for 3 hours and thanks to you i finally connect , thanks!
Thank you much, first time using REST API so wasn't really sure how to translate the API documentation to python code, this helped clear it up quick and easy, thank you for creating!
Great video! I watched a few others that were overly complicated, but this was easy to follow and got me up and running. Thanks!
You are an absolute BOSS for making this. Thank you for your help. Really good format. Straight to the point, no BS.
Thank you very much.
I looked for several videos in my language and I couldn't find it, here it was fast and objective.
Message from Brazil.
Simple and to the point. Thanks a lot
Great video. Simple and explanatory.
Very very simple explanation and helpful !! Thx Bro!!
Thank you very much. Awesome tutorial.
Thank you so much for this video!
Thank you. Helped a lot!!
this helped me out so much thanks
Great work ❤
Simple and precise. Way to go! Awesome
Glad you liked it!
Thank youuuu!
Thx bro , you saved my ass today.God bless you!
Short and crisp
I'm doing a bot traffic,and in authentication (log-in) i get a 429 error....I try to put some delays but nothing happent..Do you have any idea?
i need to automate api more than one user in that case i can't use in payload username and password, what should i do,
Thank you!!!
well explained. Could you in next video add how to cache the token so that it can be reused in subsequent calls? Mainly for performance reasons.
Hey dude! How can I make login in a website that needs a verification code? I have it all: urls, user, pass and gmail credentials (because verification code is sent to gmail) I just need to put that code on the verification URL.
Thank you
Man, você me ajudou muito em um case no meu trabalho.
Muito obrigado!!!
Brasil na área!!
thanks!
this is very helpful, I just want to ask have to dealt with any type of authentication where there are token's involved as well as decoding those tokens?
Hey! normally anytime there's tokens involved you can include them with the payload you send in your POST request. Decoding just depends on how the token is encoded. Python has some built in tools to help with these sorts of things such as codecs docs.python.org/3/library/codecs.html
Neat!
if the token should not share it with any one how can I involve it the code ? what I'm trying to say is should I put the token in different file rather than type it in the code ? and if it's yes how can I secure that file ?
There's a bunch of ways to tackle this problem. A couple common solutions would be to have the token stored as a secret within the environment that the code is executing in, and use some python like os.environ.get('token') to get that secret key.
Another way is to encrypt keys and store them somewhere accessible and call them from your script
i know it’s been a while since your comment, but for others who are wondering:
the common methodology is to “hide” the token in a .env file, and obtain it by importing the variable from .env file
My services is requesting a call back URL before they issue an API key. Where can I gat that from?
Callback urls are usually from an application you own or can write code for. So for instance an online service might use a callback url to communicate with a flask application you built to send you information (that you can do something with). You can use WayScript or any other online hosting service to create urls via something like a flask app or node server
How can you pass multiple headers that have a curl -X GET command
To pass multiple headers, you can include multiple values in the headers json with a comma after each value you want to send. Example:
headers = {'header-key-1':'header-value-1' , 'header-key-2':'header-value-2'}
You can add as many as you want, just include a comma after each. Hope that helps!
How do I add session id to header for graphql api?
Apologies for the late response, we were on break here at wayscript. To add multiple headers, you can include them like:
headers = {'header1':'value1', 'header2':'value2'}
You can add as many as you want by separating with a comma
Where did you get token value?
The token value is what you get from whatever service you're using. In this example it came from Atlassian's site > settings > Account API Token. Each service you use will likely put that token in a different place under your account settings. If you get stuck trying to find it, the site's docs will probably tell you where to find it ( if their docs are any good haha ) - Derrick
Hi wayscript, nice vid. Also wanted to say, why tf ain't y'all making a part 3 of making a ps5 bot. Part 1 and 2 are pretty much useless cause she didn't explain how to get notifications. It's one of the only good tutorials on youtube on how to make this bot. Hope to see a reaction.
Yeah her tutorials were great and part #3 has been highly requested! Unfortunately a bit out of my control. I'll put together a notification video that'll be a bit more broad than 'ps5 bot part 3' but should have all the ideas of what part 3 might of ( or might will be ). I'll make sure it integrates into that specific bot too. -Derrick
@@WayScript Thanks a lot for your reply (: really appreciate it.
get? Why not post?
I don't sub to any channel out there specially the ones that just make us waste time, hate those that don't provide any value and begs for like.. I really like to curate my feed with good stuff in order to have nice information videos on my feed and bro your channel definitely is part of my feed now .. Amazing work, congrats .. hate that I'm finding yours just now
PS5 Restock Part 3 please.
The guy looks like Milla Jovovich's son!
😂😂😂
Thank you