def upload_handler(http_receive, request): cerver.http_request_multi_parts_print(request) value = cerver.http_request_multi_parts_get_value(request, "value".encode('utf-8')) if value: print(value.contents.str) cerver.http_response_json_msg_send(http_receive, 200, "Upload works!".encode('utf-8'))
def jobs_handler (http_receive, request): global job_queue value = cerver.http_request_multi_parts_get_value ( request, "value".encode ('utf-8') ) data = Data (value) cerver.threads.job_handler_wait (job_queue, data, None) cerver.http_response_json_msg_send ( http_receive, 200, data.result.encode ('utf-8') )
def adios_handler (http_receive, request): cerver.http_response_json_msg_send ( http_receive, 200, "Adios handler!".encode ('utf-8') )
def hola_handler (http_receive, request): cerver.http_response_json_msg_send ( http_receive, 200, "Hola handler!".encode ('utf-8') )
def main_handler (http_receive, request): cerver.http_response_json_msg_send ( http_receive, 200, "Main handler!".encode ('utf-8') )