Traceback (most recent call last):
File "", line 64, in
File "", line 61, in update_cloud_mode
IOError: Server returned HTTP response code: 422 for URL: http://10.207.21.46/cloud/mode
<data_final = json.dumps(Data)
print system.net.httpPut(url, data_final, headerValues = headers)>
data_final is of type
Can someone tell me how to fix this please?
You should get comfortable with server codes - HTTP response status codes - HTTP | MDN
For 422 -
422 Unprocessable Content
The request was well-formed but was unable to be followed due to semantic errors.
So seems like for the most part your request is fine but perhaps the data you sent was malformed / not what the server is expecting
Thank you for the response. I do understand the server codes but I have tried to feed it all kinds of data, dictionary and string (which it can possibly accept).
Since it is giving the same error. So i thought of asking it here
Normally API's should have documentation on what you should be sending them. Do you have a link to that?
@pturmel Thank you so much sir!
@pturmel Can you please tell me the syntax for
httpClient() or a place where I can find it for the PUT commands