I am following the creating products on spreadshirt api tutorial and everything is acting as it should until I get to the “Upload the pixel design” part. Below is in python.
r = requests.put(formatted_url, data = open(‘please_work.png’, ‘rb’))
The formatted url contains the session id, time, url, method etc as a query string and works with all previous requests. I have successfully completed a post request with a similar format in order to get the design id.
The above put request gives me a 200 status code response with nothing in the text response area. Header being sent back to me shows ‘Content-Length’: ‘0’
I have tried switching the data to files, tried open().read() as a data param and many other variations.
Some variations of my attempts return:
“Sorry, the server encountered an internal error that prevent it from fulfilling this request!
Reason: The requested format is not supported by the given resource”
Even with this empty response I have continued the tutorial to the final stage, product creation with the below response(I had to format and erase some of it due to posting restrictions).
Nothing shows up in my marketplace items or designs. I am not sure if my design was ever uploaded as I cannot find it and I am attributing this to an unsuccessful design PUT request which returns an empty status code 200 response.
Does the spreadshirt api expect the put request to have the .png in a certain format?