在我的代码中,当某个异常发生时,我会返回
app.factory('Noticias', function($http, $q) {
var http_get_success_callback = function(data) {
var entries = data.responseData.feed.entries;
return entries;
};
var jsonData = $q.when($http.get("http://ajax.googleapis.com/ajax/services/feed/load", { params: { "v": "1.0", "q": "http://www.furg.br/bin/rss/noticias.php", "num":"10" } }).then(http_get_success_callback));
this.getAllNoticias = function() {
return jsonData;
}
this.getIndexNoticia = function(index) {
return jsonData[index];
}
});
使用Postman我很惊讶地发现了3件事:
Response.AddHeader("X-Status", "çãõáéí");
Response.Charset = "utf-8";
Response.HeaderEncoding = Encoding.UTF8;
return new HttpStatusCodeResult(403, "You lack permission X, Y and Z");
标题只是“text / html”而不是“text / html charset = utf-8”那么,我怎样才能“让”身体变空?这意味着我希望回复的内容清楚...如果你能教我编码Content-Type
,那么浏览器会正确地显示特殊的字符,而不是像一个颠倒的问号...... / p>