Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

GET respnse is always empty but with status 200

Ali Salem
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 26, 2017

hello,

I am trying to use API so I tested it with Postman and it did work but when I use Mozilla Firefox it answers with status ok 200 but without any response.

please, can anyone help me?

this my JavaScript code:

 var settings = {
              "async": true,
              "crossDomain": true,
              "url": "http://localhost:8080/rest/api/2/issuetype/10006",
              "method": "GET",
              "headers": {
                "cache-control": "no-cache",
               "postman-token": "05769be8-57c8-6710-91ad-eff30eaa2ab4"
              },
              "data": "{ \"username\": \"admin\", \"password\": \"admin\" }"
            }

            jQuery.ajax(settings).error(function (response) {
              console.log('++++++++++++++++++++++++This is it :'+response);
            });

error function work and the response is always empty.

1 answer

0 votes
Josh Steckler
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
July 26, 2017

You might need to look into adding Accept and Content-Type headers too.

Both should be "application/json"

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events