cancel
Showing results for 
Search instead for 
Did you mean: 

Python: Server can not understand Content-Type HTTP header media type "1"

Python: Server can not understand Content-Type HTTP header media type "1"

Hi, I've been struggling with a Magento 1.9 and Oauth 1.0

 

I have successfully used requests_oauthlib to create OAuth1Session and OAuth1 objects and can call these using GET:

 

https://<host>/api/rest/orders/144040

https://<host>/api/rest/customers/78394

 

But, when I call the following:

 

 

    data = {
        u'date_prescription_ob_expires': u'2017-12-02 00:00:00',
        u'prescription_ob_approved_bool': '1'
        }
       
    jd = json.dumps(data)
    
    HEADER = {'Content-Type':'application/json'} 
    result = requests.put(url, auth=oauthOne, headers=HEADER, data=jd)

 

I get the error:

 

Server can not understand Content-Type HTTP header media type "1"

 

I've been going down the rabbit hole on this for a week or so without any luck so any help or guidance is appreciated. 

 

Thanks,

Mike