Last active
July 24, 2020 16:46
-
-
Save ssukhpinder/1d36fa6cdb242b24f234e23cede85938 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flask | |
from flask import request, jsonify | |
import json | |
def main(): | |
if not request.json: | |
abort(400) | |
jsonBody =request.json[“numbers”] | |
number1=int(jsonBody[0][‘number1’]) | |
number2=int(jsonBody[1][‘number2’]) | |
return jsonify({‘total’:number1+number2}), 200 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment