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

Use XML body format instead of form encoding #302

Merged
merged 4 commits into from
Aug 30, 2020

Conversation

bartonip
Copy link
Contributor

@bartonip bartonip commented Aug 27, 2020

This wrapper gets a 500 error when submitting POST requests to Payroll API because it submits the body of the request as an XML string in the application/x-www-form-encoded format.

As outlined by Xero support below, the Payroll API does not support this format and requires XML or JSON. Since we are converting dictionaries to XML anyway, we may as well update save_or_put to submit the full XML in the body of the request and supply an application/xml header.

Copy link
Owner

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable; surprising that this hasn't come up previously.

However, we need a test to verify that this behavior is being applied (and will stay that way in future).

@bartonip
Copy link
Contributor Author

@freakboy3742 tests added as requested

Copy link
Owner

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - thanks for the patch!

@freakboy3742 freakboy3742 merged commit d314039 into freakboy3742:master Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants