Hello everyone,
I am using a web service that returns JSON data.
test.com/incident.do?JSON&sysparm_action=getRecords
Loading this URL in a browser prompts me to open incident.do, which opened in Notepad displays the valid JSON data.
Then, in a web page in the same domain, I use this:
$.ajax({
beforeSend: function(xhr) {
xhr.setRequestHeader('Authorization', authinfo);
},
url: "https://test.com/incident.do?JSON&sysparm_action=getRecords",
dataType: 'json',
type: 'GET',
success: function(a,b,c) {
alert(a);
}
});
However, with this code I am not receiving any JSON, I get only this response
HTTP/1.1 200 OK
Date: Tue, 13 Jul 2010 22:28:09 GMT
Server: Apache-Coyote/1.1
Allow: GET, HEAD, POST, TRACE, OPTIONS
Content-Length: 0
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/plain
What am I doing wrong here?
EDIT: If it helps anyone, I have a link to the sandbox on the provider's website that provides the same functionality...The username/password is admin/admin
https://demo.service-now.com/incident.do?JSON&sysparm_action=getRecords