122
rated 0 times
[
125]
[
3]
/ answers: 1 / hits: 23298
/ 11 Years ago, fri, july 12, 2013, 12:00:00
How do I extract the response content (only body) without headers?
$.ajax({
type: GET,
url: http://myRestservice.domain.com,
success: function(data, textStatus, request){
alert(data); //This prints the response with the header.
},
error: function(){
alert('fail');
}
});
The above code prints
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 12 Jul 2013 20:24:06 GMT
Content-Length: 232
<?xml version=1.0 encoding=utf-8?>
<string xmlns=http://tempuri.org/>{UserID:3,RoleID:8,ActivityID:3,RoleIName:E,,Duration:10,ValidationMsg:Passed}</string>
I need to extract the value of ValidationMsg. This is a rest service call.
How do I get the response without header informations?
More From » jquery