-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix POST/PUT with querystring #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Example: from flask import Flask
from flask.ext.restful import reqparse, Api, Resource
app = Flask(__name__)
api = Api(app)
class Bar(Resource):
def post(self):
parser = reqparse.RequestParser()
parser.add_argument('foo') # default argument location is ('json', 'values')
parser.add_argument('baz')
args = parser.parse_args()
return args
api.add_resource(Bar, '/')
app.run() Result:
Result with the patch:
|
Is this project abandoned? |
@mindflayer thanks for the fix. It looks like there are no tests that check that reqparse can actually pull arguments from two different sources. I tested your solution manually and it seems to be OK, but I'd love it if you could provide a test case that exercises the behavior you described in the above comments. |
Testing both JSON and values location in a single request
Here you are, @joshfriend ! 👍 |
fixes not being able to extract args from multiple places with reqparse.
Thank you! |
If you send a JSON body but your url contains querystring arguments, only JSON content will be returned.