Ismar Slomic Ismar Slomic - 2 years ago 451
jQuery Question

Calling JIRA REST Api from Javascript in local HTML file

I´m trying to call JIRA REST Api from javascript in HTML running locally by using jQuery.ajax function like below:

type: "GET",
url: "",
dataType: "json",
contentType: "application/json",
async: false,
beforeSend: function (xhr) {
var base64 = "YWRtaW46YWRtaW4";
xhr.withCredentials = true;
xhr.setRequestHeader("Authorization", "Basic " + base64);
.fail(function (error) {

When opening HTML file in Chrome I get following error in console:

NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load ''.

However, I can successfully access the same JIRA REST Api by using CURL locally:

curl -D- -X GET -H "Authorization: Basic YWRtaW46YWRtaW4" -H "Content-Type: application/json" ""

Any tip on how to get this working from JavaScript?

Answer Source

Thanks @Andreas!


open /Applications/Google\ --args --disable-web-security

Note, this is just a temporary solution on CORS issues locally on my machine and is only used for testing purpose.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download