jscott1989 / python-pipedrive

Python API for interacting with the pipedrive.com API
MIT License
93 stars 44 forks source link

leads endpoint only allows json content #21

Open wesselvdrest opened 3 years ago

wesselvdrest commented 3 years ago

see changelog

to fix this a POST_JSON method could be added to thee _request definition!:

...
elif method == "POST_JSON":
            uri = PIPEDRIVE_API_URL + endpoint + '?api_token=' + str(self.api_token)
            response, data = self.http.request(uri, method="POST", body=json.dumps(data), headers={'Content-Type': 'application/json'})
...

This is also the case for PATCH but I'm not using that method.