Topic: Interaction with JIRA REST API

Good afternoon!
Faced a problem at attempt to create issue in Jira through REST API. And review through method GET works perfectly, and here POST and PUT in any do not want to work. I use sample enough code:
req utl_http.req;
res utl_http.resp;
url varchar2 (4000): = ' http://host:port/rest/api/latest/issue/ ';
buffer varchar2 (4000);
content varchar2 (4000): =
' {
"fields": {
"id": "10000"
"summary": "Auto generated";
"description": "Creating of an issue using the REST API";
"issuetype": {
"id": "3"
-- To generate request
req: = utl_http.begin_request (url, ' POST ');
utl_http.set_header (req, ' Authorization ', ' Basic bG9naW46cGFzc3dvcmQ = ');
utl_http.set_header (req, ' Content-Type ', ' application/json ');
utl_http.write_text (req, content);
-- To receive the answer
res: = utl_http.get_response (req);
utl_http.read_text (res, buffer);
In the answer I receive from the server the code 400 without any explanations (res.status_code = 400, res.reason_phrase = null). And, the result generally does not depend on a body of request in any way. Shoveled a great lot of materials, but the suitable decision and did not find.


Re: Interaction with JIRA REST API

Specification: result utl_http.read_text (res, buffer) is {"errorMessages": ["No content to map to Object due to end of input"]}


Re: Interaction with JIRA REST API

Missed the mark with a forum?


Re: Interaction with JIRA REST API

There is God knows how many the applications using JIRA REST API. So it was added that me does not interest how to rewrite this program on curl, or java, or still something the friend, therefore asked here.


Re: Interaction with JIRA REST API

As it was clarified, it was necessary to transfer in an explicit form title Content-Lentgh (length of a body of request bytes).


Re: Interaction with JIRA REST API

Landside wrote:

therefore asked here.

All the same remained  a question as it is connected  to http-problems of dialogue with jira.