MrRefactoring / jira.js

A JavaScript/TypeScript wrapper for the JIRA Cloud, Service Desk and Agile REST API
https://mrrefactoring.github.io/jira.js/
MIT License
366 stars 49 forks source link

415 'Unsupported Media Type' when POSTing #144

Closed lopis closed 3 years ago

lopis commented 3 years ago

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

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

MrRefactoring commented 3 years ago

Fixed in version 2.4.2

lopis commented 3 years ago

Really appreciated!