post request form now conforms
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2020-04-29 22:55:26 +02:00
parent 503ffe7f9a
commit 7abec4e257
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import logging import logging
import json
from xeger import Xeger from xeger import Xeger
from flask_restful import Resource from flask_restful import Resource
from flask import request from flask import request
@ -69,11 +70,12 @@ class SampleResource(Resource):
requests.post( requests.post(
f"http://{STORAGE_HOSTNAME}/object", f"http://{STORAGE_HOSTNAME}/object",
files={ files={
'tag': (None, generated_tag), 'description': (None, json.dumps({'tag': generated_tag}), 'application/json'),
'file': ( 'soundfile': (
'wave.wav', 'wave.wav',
soundfile, soundfile,
soundfile.content_type)}) soundfile.content_type,
{'Content-Length': len(soundfile)})})
rabbitmq_channel.basic_publish( rabbitmq_channel.basic_publish(
exchange=RABBITMQ_EXCHANGE, exchange=RABBITMQ_EXCHANGE,
routing_key='feature', routing_key='feature',