def process_demoroom_members():
# Verify that the request is propery authorized
#authz = valid_request_check(request)
#if not authz[0]:
# return authz[1]
status = 200
if request.method == "POST":
data = request.form
try:
sys.stderr.write("Adding %s to demo room.\n" % (data["email"]))
reply=send_welcome_message(data["email"])
status = 201
resp = Response(reply, content_type='application/json', status=status)
except KeyError:
error = {"Error":"API Expects dictionary object with single element and key of 'email'"}
status = 400
resp = Response(json.dumps(error), content_type='application/json', status=status)
# demo_room_members = get_membership()
# resp = Response(
# json.dumps(demo_room_members, sort_keys=True, indent = 4, separators = (',', ': ')),
# content_type='application/json',
# status=status)
else:
resp = Response("OK", status=status)
return resp
评论列表
文章目录