Python Flask REST API GET/PUT/POST part 2

preview_player
Показать описание


How to Make Api with Swagger Python Flask and add Rate limiting to it:
Рекомендации по теме
Комментарии
Автор

Hi Soumil,
Thanks very much for this video. Really very useful and faster way of learning. Onlything I just like to mention is that there is a small issue in the "GET" method. Like when you add 2 items in the LIST via POST call and then try to use the GET Call to retrieve the second item from the list. You will see the GET Call will return you null. However, I have fixed the issue and will wait for your upcoming more videos in FLASK.

Gizmofacts
Автор

So happy to see this video, that is what I want to learn, hope more

yaxingwang
Автор

Thanks for an amazing video! I've built a restAPI using python Flask and tried to test POST request using python, it works fine with postman however keeps on giving me `response Error 500` when trying to call post request. I am running Flask server locally and sending POST request locally using python module requests.

haneulkim
Автор

Hello bro, how to run that code behind apache rather than basic flask http server? Please help.

daddy
Автор

hi, i have a question i hope you will be able to ans me.
suppose i have a flask api . now someone is calling my api from the ui side sending multiple request may be same or different requests. is there any way that i can count those number of request. and some how i can make those request concurent ???
thank you in advance ans me if you know

abhisekhagarwala
Автор

bro, your get and delete methods need 'name' as a parameter also. In the vid only POST has it!

adityasethi
Автор

would i get python + flask + jwt token code?

amitgoodguys
Автор

sir i have no words how to say thanks but as a regard thanks to youreally helpfull

arshdeepkaur
Автор

Hi Soumil! Thank you very much for your videos. Nice work. I have a doubt with your get definition: do you need a name input on that? Best!

fgreve
Автор

Hi soumil! I was wondering if you know how can I get a HTTP Status Code of 205?

antonietapintorebelo
Автор

How to create a flask API to handle a POST request and return a list of scores and the input format is json data

kumkumchoudhary
Автор

JSON is not dict .... in python... they just look similar. isn't it?

findsarfaraz
Автор

after adding Soumil and Shah both if you hit a get request "shah" still its giving the {data : null }

saumyadiptasarkar
Автор

from flask import Flask, request
from flask_restful import reqparse, abort, Api, Resource

app = Flask(__name__)
api = Api(app)
Data=[]

class People(Resource):
def get(self, name):
for x in Data:
if x['Data'] == name:
return {'Data':name}
else:
return {'Data':None}


def post(self, name):
Tem={'Data':name}
Data.append(Tem)
return Tem

def delete(self, name):
for ind, x in enumerate(Data):
if x['Data'] == name:
Tem=Data.pop(ind)
return {'Note':'Deleted'}

api.add_resource(People, '/<string:name>')
if __name__ == '__main__':
app.run(debug=True)

shivigargi
Автор

It sucks when you were copying each and every line from these guys carefully, and still it doesn't work on your machine. My Post request is working. Thanks for that. But Get request is not working. "Unexpected argument name" is the exception. I though I will learn this REST Api thing from your tutorial. But now I am dropping out.

ketankulkarni