def auth_form(environ, start_response): towrite = "Challenging this" content_length = CONTENT_LENGTH.tuples(str(len(towrite))) content_type = CONTENT_TYPE.tuples('text/html') headers = content_length + content_type + forget_headers start_response('200 OK', headers) return [towrite]
def auth_resp(environ, start_response): import json resp = {"success": True} resp_str = json.dumps(resp) content_length = CONTENT_LENGTH.tuples(str(len(resp_str))) content_type = CONTENT_TYPE.tuples('application/json') headers = content_length + content_type start_response('200 OK', headers) return [resp_str]
def auth_resp(environ, start_response): import json resp = { "success": True } resp_str = json.dumps(resp) content_length = CONTENT_LENGTH.tuples(str(len(resp_str))) content_type = CONTENT_TYPE.tuples('application/json') headers = content_length + content_type start_response('200 OK', headers) return [resp_str]
def auth_form(environ, start_response): content_length = CONTENT_LENGTH.tuples(str(len(form))) content_type = CONTENT_TYPE.tuples('text/html') headers = content_length + content_type + forget_headers start_response('200 OK', headers) return [form]