Objects sent to JIRA via cURL in JSON format have line breaks stripped
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
When using cURL to retrieve JSON packets for JIRA, the output of cURL has no line breaks. This makes them very hard to read.
Cause
This is caused by cURL defaulting to ASCII mode, which does not respect line breaks.
Resolution
To resolve this, explicitly throw the
--data-binary
argument, like so:1
curl -D- -u user:pass -X POST -H "Content-Type: application/json" --data-binary @ngr-ver-XX.test http://jiraserver:8080/rest/api/latest/issue
Was this helpful?