-
Notifications
You must be signed in to change notification settings - Fork 36
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
added /postvalidate route for JSON POST validation #25
Conversation
@@ -113,7 +136,8 @@ def do_test(self): | |||
return self.format_response(infojson, fmt) | |||
|
|||
def dispatch_views(self): | |||
self.app.route("/validate", "GET", self.do_test) | |||
self.app.route("/validate", "GET", self.do_GET_test) | |||
self.app.route("/postvalidate", "POST", self.do_POST_test) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about just POSTing to /validate ? No need to introduce a new URI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, understood.
Merged, thanks @calvinbutcher! |
Thanks, @calvinbutcher, this is very useful! I have a couple of issues/questions about this:
|
1 would be because the new code isn't deployed yet :) I expect that 2 is that the JSON is in the body of the POST, rather than web form encoded. |
Thanks, Rob! Please let me know when it's deployed by commenting here. |
New "/postvalidate" route receives POST of JSON body-text with a Content-Type:application/json. Responds with JSON returning the received data, an okay flag, warnings, and errors.