GET respnse is always empty but with status 200

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 vote
Josh Steckler Community Champion Jul 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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

685 views 6 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you