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'." }"
@limzhengyang73642 жыл бұрын
thanks! needed this!
@Holasoyfelipesochao Жыл бұрын
I needed this too, even tho i'm on windows. Thanks!
@ikeandmama57692 жыл бұрын
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.
@JummaJara2 жыл бұрын
Thank you every much for easy practice, it’s help me a lot to conclude how flask-rest API works. Keep it up!!
@zindamayat3 жыл бұрын
Bro, you are an Angel for me, Finally, I learn how to make an API after a couple of months I waste.
@jamesbriggs3 жыл бұрын
awesome, happy to help!
@prafulmaka77102 жыл бұрын
This was short, sweet and exactly what I was looking for. Thank you!!
@python3603 жыл бұрын
Thanks James, the TDS article is excellent. Having the article to go with the video is really useful👍
@jamesbriggs3 жыл бұрын
happy you've found it useful - I do usually include an article with each video :)
@sascha. Жыл бұрын
18:24 gave me an error without adding location='args' to parser.add_argument().
@wilrulez8112 жыл бұрын
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?
@ianault85992 жыл бұрын
I have the same issue, did you find the cause yet?
@xRays62 жыл бұрын
yooo, same error, any solution?
@ianault85992 жыл бұрын
@@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 Жыл бұрын
@@ianault8599 thank you!!
@yudisthirairianaputra3531 Жыл бұрын
@@ianault8599 Thankyou, browsing a lot of solution and the only one works it your solution
@NickTenBrink Жыл бұрын
very easy to follow along, thanks!
@harryayce113 жыл бұрын
Well explained! Looking forward to part 3.
@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
@nabeelahmed42032 жыл бұрын
how to get/post data from/to sql server instead of csv file ?
@MrLeMarius2 жыл бұрын
Thanks a lot for this explanation, very clear and will save me a lot of time!
@zelaTVV2 жыл бұрын
It's really well explained !
@mrunalsonawane33633 жыл бұрын
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?
@jamesbriggs3 жыл бұрын
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!
@mrunalsonawane33633 жыл бұрын
Great video! Masterfully explained
@bnproduction92983 жыл бұрын
hi james. is there a flask library for graphql ?
@jamesbriggs3 жыл бұрын
I haven't used graphql but it seems there is, can find it here: github.com/graphql-python/flask-graphql
@stangerdanger72523 жыл бұрын
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?
@jamesbriggs3 жыл бұрын
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 :)
@stangerdanger72523 жыл бұрын
@@jamesbriggs Thank you for the reply.
@katericataa2 жыл бұрын
ty for the video
@yazaaqa2 жыл бұрын
what IDE you are using ?
@jamesbriggs2 жыл бұрын
VS Code with Night Owl theme :)
@veroniquereagon89423 жыл бұрын
Hi there, is this an example of a REST API?
@jamesbriggs3 жыл бұрын
it is yes :)
@veroniquereagon89423 жыл бұрын
@@jamesbriggs Cool Thanks. How do you deploy a Flask API?
@jamesbriggs3 жыл бұрын
@@veroniquereagon8942 working on a video for this - should be out next week
@jamesbriggs3 жыл бұрын
Here you go :) kzbin.info/www/bejne/aZfWepaDnLqCj5o
@lordmelbury71742 жыл бұрын
@@jamesbriggs Great video - I'm going to follow along and delpoy it on my Google Cloud as well!