I am working on my first flash application (version 0.10.1), as well as my first Python application (version 3.5). One of its parts should work as follows:
- Submit form
- Run the Celery task (which causes some third-party API calls)
- When the Celery task API API ends, send a JSON message to a different URL in the application
- Get the JSON data and update the database record with it
Here's the relevant part of Celeryβs task:
if not response['errors']:
message = {'flask_id' : flask_id, 'sf_id' : response['id']}
message = json.dumps(message)
print('call endpoint now and update it')
res = requests.post('http://0.0.0.0:5000/transaction_result/', json=message)
And here is the endpoint that it calls:
@app.route('/transaction_result/', methods=['POST'])
def transaction_result():
result = jsonify(request.get_json(force=True))
print(result.flask_id)
return result.flask_id
For now, I'm just trying to get the data and print the identifier, and after that I will worry about the database.
The error I am getting is this: requests.exceptions.ConnectionError: None: Max retries exceeded with url: /transaction_result/ (Caused by None)
, JSON, Force = True , , , . CocoaRestClient Content-Type /json, .
, , .