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

415 'Unsupported Media Type' when POSTing #144

Closed
lopis opened this issue Jul 8, 2021 · 3 comments · Fixed by #145
Closed

415 'Unsupported Media Type' when POSTing #144

lopis opened this issue Jul 8, 2021 · 3 comments · Fixed by #145
Labels
bug Indicates a reported issue or malfunction that needs fixing.

Comments

@lopis
Copy link

lopis commented Jul 8, 2021

While trying to use the REST API to vote on an issue, I got the 415 'Unsupported Media Type' error. The API seems to expect that these requests body are in application/json format, but the requests are instead being sent as application/x-www-form-urlencoded.

Could this be a change from the API or am I missing some config? Other POST calls seem to also expect JSON. Adding the following line to the request config fixes the problem:

https://github.com/lopis/jira.js/blob/master/src/version3/issueVotes.ts#L85

@MrRefactoring
Copy link
Owner

Hi @lopis! Thanks for letting me know. I will check it soon

@MrRefactoring MrRefactoring added the bug Indicates a reported issue or malfunction that needs fixing. label Jul 8, 2021
MrRefactoring added a commit that referenced this issue Jul 8, 2021
* types improvements

* types improvements

* assign required arguments fixed

* assign required arguments fixed

* #144 fixed error when tried vote issue

* eslint fixed

* tests added

* issue votes type fixed

* integration to e2e rename

* tests fixed
@MrRefactoring
Copy link
Owner

Fixed in version 2.4.2

@lopis
Copy link
Author

lopis commented Jul 8, 2021

Really appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates a reported issue or malfunction that needs fixing.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants