def data_get(emp_code): if request.method == 'POST': # POST request print(request.get_text()) # parse as text return 'OK', 200 else: # GET request files = glob.glob('%s/%s*' % (upload_dest, emp_code)) return ','.join([i.rsplit('/', 1)[1] for i in files])
def datafind(transaction_id, second_arg): # POST request if request.method == 'POST': print('Incoming..') print(request.get_text()) # parse as text return 'OK', 200 # GET request else: message = 't_in = %s ; result: %s ; opt_arg: %s' % ( transaction_id, data[int(transaction_id)], second_arg) return message #jsonify(message) # serialize and use JSON headers
def data_get(upload_id): if request.method == 'POST': # POST request print(request.get_text()) # parse as text return 'OK', 200 else: # GET request print('%s/%s/*' % (upload_dest, sqlc.writefile(upload_id))) files = glob.glob('%s/%s/*' % (upload_dest, sqlc.writefile(upload_id))) print('------', upload_id, files) return ','.join([i.rsplit('/', 1)[1] for i in files])
def data_get(index_no): data = list(range(1, 30, 3)) #print('data = ',data) if request.method == 'POST': print(request.get_text()) return 'Ok', 200 else: return 't_in = %s ; result: %s ; ' % (index_no, data[int(index_no)])
def index(): if (request.method == 'POST'): some_json = request.get_text() return jsonify({'you:sent': some_json}), 201 else: return jsonify({"msg": "Grupo 02"})