python-harvest icon indicating copy to clipboard operation
python-harvest copied to clipboard

Fix 400 error

Open neilrqm opened this issue 4 years ago • 2 comments
trafficstars

The example code

import harvest
client = harvest.Harvest("https://COMPANYNAME.harvestapp.com", "EMAIL", "PASSWORD")
client.who_am_i

currently results in a 400 error response with the message "HTTP GET requests with a body are not accepted." This commit removes the request body (which previously evaluated to 'null') for requests where the data parameter is set to None.

neilrqm avatar Sep 09 '21 22:09 neilrqm

Hi @neilrqm

I don't know how much luck you're going to have getting this PR merged.

More than two years ago I re-wrote this library to support Harvest's API v2 and offered it in branch dev or dev_v2 but it hasn't been adopted. refer issues #43, #48, #49.

I then released the re-write as python-harvest which didn't get much traction as an open source project. I have since released Python-Harvest as a commercial library which is referenced from the Harvest integrations directory.

You can find it here; https://dachshund-turbot-6p52.squarespace.com/

I hope you find a solution which suits.

Regards,

Brad

bradbase avatar Sep 09 '21 23:09 bradbase

@neilrqm I forgot to mention, Harvest and I have worked together to ensure the Python-Harvest library v1.12.0 and above conforms to their new systems (causing the HTTP 400 on GET requests).

bradbase avatar Sep 10 '21 00:09 bradbase