I have Python-Eve
running with MongoDB
on a Ubuntu VM
. I am trying to write an api to handle POST requests from an Iridium RockBLOCK modem. I have tested the API with Chrome Postman
, and am able to successfully POST data.
When I try and send messages from my RockBLOCK
I get 422 error messages on the VM. I am pretty sure this is because the RockBLOCK
is not able to handle XML
or JSON
data, and is set up to simply look for an HTTP 200
response.
So how would I setup eve to respond with solely HTTP 200
when the POST request is received?
API Format taken from RockBLOCK Web Services Guide.
The 422
is returned from Eve when a validation error occurs. I would look into your request payload and make sure it adheres to validation rules. A typical example of a response like this would be when you have a unique
rule for a field, and a POST comes in with an already used value for that field.
So how would I setup eve to respond with solely HTTP 200 when the POST request is received?
Right now you can disable either JSON or XML responses by respectively setting JSON = False
or XML = False
, but not both. Since Eve is a Flask application you could look into changing the response on the flight but again, given the error you are getting I don't think that is the problem you are facing right now.