I've following function:
$.ajax({url:"http://127.0.0.1:8080", data: "123",
success:
function(response, textStatus, jqXHR)
{
alert(response);
},
error:
function(jqXHR, textStatus, errorThrown)
{
alert("The following error occured: " + textStatus + " " + errorThrown);
}
});
It sends request and i intercept one with "nc -l 8080". It looks like
GET /?123 HTTP/1.1
Host: 127.0.0.1:8080
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20100101 Firefox/15.0.1
Accept: */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Origin: null
Then i answer with
HTTP/1.1 200 OK
Content-Length: 3
abc
The problem is i always get error ("The following error occured: error") What do you think could be wrong with it?