[英]How to fetch custom header from HTTP response in SAPUI5?
我正在执行put操作,它在rest client中工作得很好,作为响应,我得到pgi标头,如下图所示。
现在,我尝试使用更新方法从sapui5 odatamodel中获得相同的结果。 以下是我的代码。
oModel.update("/performpgi(Srno='241')", {"Srno":"241"}, null,
function(oData, oResponse) {
console.log(oResponse.headers.pgi) //undefined
}, function(err) {});
在响应头中,我没有找到任何pgi变量。
有什么可以帮助我的吗?
谢谢。
var fnFunction = function(oEvent){
//oEvent has your complete response, headers and so on
//So you can do whatever you want to do.
//please note that this is called on failure so just handle based on response code
};
oModel.attachRequestCompleted(oData?, fnFunction, oListener?);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.