API Series #2 - Building an API with Flask in Python

  Рет қаралды 21,203

James Briggs

James Briggs

Күн бұрын

Пікірлер: 41
@thomives4353
@thomives4353 2 жыл бұрын
I agree with everyone that this video is awesome. However, if you're on linux, I found that I had to add location='values' to the parser.add_argument method calls in the post method -> parser.add_argument('userId', required=True, location='values') . Once I did that, problems solved. The message that I was getting was "{ "message": "Did not attempt to load JSON data because the request Content-Type was not 'application/json'." }"
@limzhengyang7364
@limzhengyang7364 2 жыл бұрын
thanks! needed this!
@Holasoyfelipesochao
@Holasoyfelipesochao Жыл бұрын
I needed this too, even tho i'm on windows. Thanks!
@ikeandmama5769
@ikeandmama5769 2 жыл бұрын
Hi, James, thank you for the practice. I have a question. The post method works great at 127..0.0.1:5000. However, when I deployed the python flask to IIS, the post method is not working at localhost:port/users?…not sure if I miss anything.
@JummaJara
@JummaJara 2 жыл бұрын
Thank you every much for easy practice, it’s help me a lot to conclude how flask-rest API works. Keep it up!!
@zindamayat
@zindamayat 3 жыл бұрын
Bro, you are an Angel for me, Finally, I learn how to make an API after a couple of months I waste.
@jamesbriggs
@jamesbriggs 3 жыл бұрын
awesome, happy to help!
@prafulmaka7710
@prafulmaka7710 2 жыл бұрын
This was short, sweet and exactly what I was looking for. Thank you!!
@python360
@python360 3 жыл бұрын
Thanks James, the TDS article is excellent. Having the article to go with the video is really useful👍
@jamesbriggs
@jamesbriggs 3 жыл бұрын
happy you've found it useful - I do usually include an article with each video :)
@sascha.
@sascha. Жыл бұрын
18:24 gave me an error without adding location='args' to parser.add_argument().
@wilrulez811
@wilrulez811 2 жыл бұрын
Hello! I'm following along and just finished the POST method, but whenever I try to do the command I get a 400 error, even after copy/pasting the code from the article. Help?
@ianault8599
@ianault8599 2 жыл бұрын
I have the same issue, did you find the cause yet?
@xRays6
@xRays6 2 жыл бұрын
yooo, same error, any solution?
@ianault8599
@ianault8599 2 жыл бұрын
@@xRays6 Yes! parser.add_argument("email", required=False, type=str, location="args") You need to add the location="args" at the end!!! Something to do with Mac and Windows being different I think but with the location="args" it works on everything.
@NickTenBrink
@NickTenBrink Жыл бұрын
@@ianault8599 thank you!!
@yudisthirairianaputra3531
@yudisthirairianaputra3531 Жыл бұрын
@@ianault8599 Thankyou, browsing a lot of solution and the only one works it your solution
@NickTenBrink
@NickTenBrink Жыл бұрын
very easy to follow along, thanks!
@harryayce11
@harryayce11 3 жыл бұрын
Well explained! Looking forward to part 3.
@rmunson96
@rmunson96 Жыл бұрын
Getting this error trying to run the code "Object of type method is not JSON serializable" the error is coming from this line return {'data': data}, 200 because the data prints correctly just before this
@nabeelahmed4203
@nabeelahmed4203 2 жыл бұрын
how to get/post data from/to sql server instead of csv file ?
@MrLeMarius
@MrLeMarius 2 жыл бұрын
Thanks a lot for this explanation, very clear and will save me a lot of time!
@zelaTVV
@zelaTVV 2 жыл бұрын
It's really well explained !
@mrunalsonawane3363
@mrunalsonawane3363 3 жыл бұрын
Hey! So I wanna build an API with GET and POST methods and with access tokens or API keys. I want to limit functionality of certain keys to only the GET method while some should be able to do both. Can you tell me how I can do that securely?
@jamesbriggs
@jamesbriggs 3 жыл бұрын
You want to use JSON web tokens (JWT), take a look at this article geekflare.com/securing-flask-api-with-jwt/ This is a good idea for a video though - will be doing this soon, thanks!
@mrunalsonawane3363
@mrunalsonawane3363 3 жыл бұрын
Great video! Masterfully explained
@bnproduction9298
@bnproduction9298 3 жыл бұрын
hi james. is there a flask library for graphql ?
@jamesbriggs
@jamesbriggs 3 жыл бұрын
I haven't used graphql but it seems there is, can find it here: github.com/graphql-python/flask-graphql
@stangerdanger7252
@stangerdanger7252 3 жыл бұрын
Is there any difference between REST APIs written in Python or others. Like, can we call Python API from Flutter Android app. Is that be a good practice?
@jamesbriggs
@jamesbriggs 3 жыл бұрын
Internally they are written in another language, but externally they should appear and behave in the exact same way. Eg if I want to communicate with the Twitter/Reddit API, I should be able to use any language and not care about which language they wrote the API in So yes Python API from Flutter Android app is completely fine :)
@stangerdanger7252
@stangerdanger7252 3 жыл бұрын
@@jamesbriggs Thank you for the reply.
@katericataa
@katericataa 2 жыл бұрын
ty for the video
@yazaaqa
@yazaaqa 2 жыл бұрын
what IDE you are using ?
@jamesbriggs
@jamesbriggs 2 жыл бұрын
VS Code with Night Owl theme :)
@veroniquereagon8942
@veroniquereagon8942 3 жыл бұрын
Hi there, is this an example of a REST API?
@jamesbriggs
@jamesbriggs 3 жыл бұрын
it is yes :)
@veroniquereagon8942
@veroniquereagon8942 3 жыл бұрын
@@jamesbriggs Cool Thanks. How do you deploy a Flask API?
@jamesbriggs
@jamesbriggs 3 жыл бұрын
@@veroniquereagon8942 working on a video for this - should be out next week
@jamesbriggs
@jamesbriggs 3 жыл бұрын
Here you go :) kzbin.info/www/bejne/aZfWepaDnLqCj5o
@lordmelbury7174
@lordmelbury7174 2 жыл бұрын
@@jamesbriggs Great video - I'm going to follow along and delpoy it on my Google Cloud as well!
Intro to APIs in Python - API Series #1
28:24
James Briggs
Рет қаралды 7 М.
REST API Crash Course - Introduction + Full Python API Tutorial
51:57
HELP!!!
00:46
Natan por Aí
Рет қаралды 55 МЛН
How to Easily Create REST APIs with Flask-RESTX
35:36
Pretty Printed
Рет қаралды 32 М.
ChatGPT Plugins: Build Your Own in Python!
41:06
James Briggs
Рет қаралды 144 М.
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
13:26
James Briggs
Рет қаралды 14 М.
Python Flask Crash Course 2023
1:34:18
Bitfumes
Рет қаралды 9 М.
GPT 4: Superpower results with search
27:10
James Briggs
Рет қаралды 31 М.
Rest API - Best Practices - Design
15:50
High-Performance Programming
Рет қаралды 112 М.
How-to Use The Reddit API in Python
23:21
James Briggs
Рет қаралды 56 М.
Why You NEED To Learn FastAPI | Hands On Project
21:15
Travis Media
Рет қаралды 167 М.