Worklight:WL.Client.addGlobalHeader()无效 [英] Worklight: WL.Client.addGlobalHeader() has no effect

查看:87
本文介绍了Worklight:WL.Client.addGlobalHeader()无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我添加行

WL.Client.addGlobalHeader("MyCustomHeader","abcdefgh");

在我的主要js文件中如此

inside of my main js file like so

function wlCommonInit(){

WL.Client.addGlobalHeader("MyCustomHeader","abcdefgh");
    (...)

就像它在文档中描述的那样( http://pic.dhe。 ibm.com/infocenter/wrklight/v5r0m5/topic/com.ibm.worklight.help.doc/apiref/r_wl_client_addglobalheader.html )此后所有请求发送绝对没有效果:

like it's described in the documentation (http://pic.dhe.ibm.com/infocenter/wrklight/v5r0m5/topic/com.ibm.worklight.help.doc/apiref/r_wl_client_addglobalheader.html) this has absolutely no effect all request send after that:

GET /apps/services/preview/MobileOPMClient/common/0/default/images/icons/icon_settings.png             
HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Accept: image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/30.0.1599.66 Safari/537.36
Referer: http://localhost:8080/apps/services/preview/MobileOPMClient/common/0/default/MobileOPMClient.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,de;q=0.6
Cookie: JSESSIONID=1e1fig7holfdpeuc46w6jmrph; testcookie=oreo

为什么没有行

MyCustomHeader: abcdefgh

背景:我想允许本地缓存javascript文件以在chrome中调试它们。

Background: I would like to allow local caching of javascript-files to debug them in chrome.

spyro

推荐答案

为WL客户端API发出的请求添加了全局标头,例如WL.Client.connect(),WL.Client.invokeProcedure()等。

Global headers are added for requests made by WL client API, for example WL.Client.connect(), WL.Client.invokeProcedure() etc.

这篇关于Worklight:WL.Client.addGlobalHeader()无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆