lionheart / python-harvest

A Python wrapper for the Harvest time-tracking API.
Apache License 2.0
55 stars 49 forks source link

Fix 400 error #51

Open neilrqm opened 3 years ago

neilrqm commented 3 years ago

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.

bradbase commented 3 years ago

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 commented 3 years ago

@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).