Python Flask REST API GET/PUT/POST part 2

Поделиться
HTML-код
  • Опубликовано: 4 фев 2025

Комментарии • 36

  • @Gizmofacts
    @Gizmofacts 4 года назад +3

    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.

  • @arshdeepkaur3993
    @arshdeepkaur3993 2 года назад

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

  • @yaxingwang8720
    @yaxingwang8720 5 лет назад +1

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

  • @josueperez7232
    @josueperez7232 3 года назад

    And the PUT?

  • @adityasethi9794
    @adityasethi9794 4 года назад +4

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

  • @haneulkim4902
    @haneulkim4902 3 года назад

    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.

  • @abhisekhagarwala9501
    @abhisekhagarwala9501 4 года назад

    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

  • @ronakjain6592
    @ronakjain6592 4 года назад

    Can we use it in Chatbot flask api

  • @shivigargi4293
    @shivigargi4293 4 года назад +1

    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,'/')
    if __name__ == '__main__':
    app.run(debug=True)

  • @kumkumchoudhary4293
    @kumkumchoudhary4293 4 года назад

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

    • @SoumilShah
      @SoumilShah  4 года назад +1

      It’s really easy follow my basic tutorial on flask

    • @kumkumchoudhary4293
      @kumkumchoudhary4293 4 года назад

      @@SoumilShah can you tell me which tutorial should I watch.

  • @fgreve
    @fgreve 4 года назад

    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!

    • @SoumilShah
      @SoumilShah  4 года назад +1

      No that was just for explanation I took that example

  • @findsarfaraz
    @findsarfaraz 5 лет назад +1

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

    • @SoumilShah
      @SoumilShah  5 лет назад

      sarfaraz ahmed almost same
      Dict can be convert to json with dumps method

  • @amitgoodguys
    @amitgoodguys 5 лет назад

    would i get python + flask + jwt token code?

  • @antonietapintorebelo5020
    @antonietapintorebelo5020 4 года назад

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

    • @SoumilShah
      @SoumilShah  4 года назад

      Antonieta Pinto Rebelo put 205 after you do your return statement. Like this return “mess”,205

    • @antonietapintorebelo5020
      @antonietapintorebelo5020 4 года назад

      @@SoumilShah Thank you so much!

  • @hokapokas
    @hokapokas 4 года назад

    CRUD- create read update delete :)

  • @janga8717
    @janga8717 4 года назад

    morsest post request I have ever seen

  • @ketankulkarni427
    @ketankulkarni427 4 года назад

    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.

    • @SoumilShah
      @SoumilShah  4 года назад +1

      Ketan Kulkarni good for you good bye

    • @ketankulkarni427
      @ketankulkarni427 4 года назад

      @@SoumilShah It's sad that instead of solving my problem you are very prompt in replying me a goid bye. Some of your viewers are beginner. They don't know shit about rest api and all. Anyways, your life is already set. I need to set mine. Already wasted enough time here. Good bye.

    • @SoumilShah
      @SoumilShah  4 года назад

      Ketan Kulkarni good maybe if you changed the tone a bit I would helped but yes good bye don’t need negative people like you here goodbye 1 negative subscriber is not going to affect me good luck

    • @ketankulkarni427
      @ketankulkarni427 4 года назад

      @@SoumilShah I was not your subscriber anyway. And definately not gonna be one. Good luck for your future.

    • @SoumilShah
      @SoumilShah  4 года назад

      Ketan Kulkarni good bye please don’t waste my or your time more thanks goodbye

  • @gajulaamar9656
    @gajulaamar9656 27 дней назад

    he skipped video when he was done eorror

  • @saumyadiptasarkar2261
    @saumyadiptasarkar2261 5 лет назад

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

    • @saumyadiptasarkar2261
      @saumyadiptasarkar2261 5 лет назад

      Only the first added post is working for get

    • @fgreve
      @fgreve 4 года назад

      @@saumyadiptasarkar2261 need to add name as an input of get()

  • @αιη-η9λ
    @αιη-η9λ 3 года назад

    عليك غضب الله

  • @daddy7973
    @daddy7973 4 года назад

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