如何提取没有标题的响应内容(仅正文)?
$.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');
}
});
上面的代码打印
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>
我需要提取ValidationMsg 的值。这是一个休息服务电话。
如何在没有标头信息的情况下获得响应?