Python Forum
Server Error with parse_args() using Flask
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Server Error with parse_args() using Flask
#1
I'm trying to develop an api using flask but i'm having a server error in post request, i use this simple code
parserTest = reqparse.RequestParser()
parserTest.add_argument('uid')

class TestPost(Resource):
    def get(self, uid):
        return {'success': f'ok {uid}'} # It works

    def post(self):
        parseTest = parserTest.parse_args()
        return {'warn': f'Parse: {parseTest}'}

api.add_resource(TestPost, '/test')
I tried using this curl requests:
curl -d "uid=asd" -X POST localhost:5000/test
Error:
{"message": "The browser (or proxy) sent a request that this server could not understand."}
curl -F "uid=asd" -X POST localhost:5000/test
Error:
{"message": "The browser (or proxy) sent a request that this server could not understand."}
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] flask 500 internal server error DarthTensor 3 4,040 Nov-11-2021, 06:10 AM
Last Post: DarthTensor
  Error updating one to many relationship in Flask/ SQLAlchemy atindra 0 3,346 Apr-15-2021, 10:29 PM
Last Post: atindra
Question Flask, Self-hosted deployment, which server ? SpongeB0B 1 3,050 Apr-11-2021, 11:29 AM
Last Post: snippsat
  TemplateNotFound error with flask Veztar 4 18,853 Aug-28-2020, 07:02 AM
Last Post: Veztar
  Flask Ubuntu Server Not Running Wheel 0 2,019 Jul-14-2020, 08:12 PM
Last Post: Wheel
  Running flask run produces error. Charles1 1 4,075 Oct-04-2019, 10:38 PM
Last Post: snippsat
  [Flask] html error 405 SheeppOSU 0 2,356 Jun-08-2019, 04:42 PM
Last Post: SheeppOSU
  [flask] mail.send giving error SheeppOSU 2 2,878 May-31-2019, 09:31 PM
Last Post: SheeppOSU
  About Error (Flask) bescf 1 2,669 Mar-20-2019, 08:18 PM
Last Post: nilamo
  Flask Error-Could not build url for endpoint 'index'. Did you forget to specify value Prince_Bhatia 0 10,320 Feb-25-2019, 05:52 AM
Last Post: Prince_Bhatia

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020