コード例 #1
0
ファイル: upload.py プロジェクト: verstand-it/py-cerver
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'))
コード例 #2
0
ファイル: jobs.py プロジェクト: verstand-it/py-cerver
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')
	)
コード例 #3
0
def adios_handler (http_receive, request):
	cerver.http_response_json_msg_send (
		http_receive, 200, "Adios handler!".encode ('utf-8')
	)
コード例 #4
0
def hola_handler (http_receive, request):
	cerver.http_response_json_msg_send (
		http_receive, 200, "Hola handler!".encode ('utf-8')
	)
コード例 #5
0
ファイル: jobs.py プロジェクト: verstand-it/py-cerver
def main_handler (http_receive, request):
	cerver.http_response_json_msg_send (
		http_receive, 200, "Main handler!".encode ('utf-8')
	)