Python Error message

dieter dieter at handshake.de
Fri Aug 5 03:03:07 EDT 2016


GBANE FETIGUE <bemen77 at gmail.com> writes:
> ...
> I am running a python script to run some CURL commands, and return the response which is the applicationId and the versionId. I was able to do it. Now the versionId value supposed to be used on the second CURL as a value of the applications key which is an array. but it doesn't work.I 'll post the error after running the command as well as the script. It seems like I have an error somewhere because the curl works manually if i run. 
>
> ec2-user at ip-172-31-21-77 playbooks]$ python mmc-uploader.py
> ...
> Final response<!DOCTYPE html><html>...<body><h1>HTTP Status 415 - </h1><div class="
>  line"></div><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server refused this request because the request entity is in a format not supported by the reque
>  sted resource for the requested method.</u></p><hr class="line"><h3>Apache Tomcat/8.0.26</h3></body></html>

What you see here is *not* a Python error message but an
error message from the server you have contacted.
It tells you:
"The server refused this request because the request entity is in a format not supported by the requested resource for the requested method."

This means, that in constructing your request you made some error - regarding
the "format" (which may mean the "Content-Type") for
the request "entity" (which may mean the request body).

I would check the service description to find out about what
"format" is expected and what the term "entity" means.
Then I would check the "curl" documentation to find out how to meet
those expectations.




More information about the Python-list mailing list