Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 400 error #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix 400 error #51

wants to merge 1 commit into from

Conversation

neilrqm
Copy link

@neilrqm neilrqm commented Sep 9, 2021

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.

* Removed empty content of request bodies
@bradbase
Copy link

bradbase commented Sep 9, 2021

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
Copy link

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

@reinhardt reinhardt mentioned this pull request Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants