Code:
Test1:function () {
$.ajax ({
type: "GET",
cache:false,
URL: "Http://smp.springworks.info:8081/app1 /test/index2.jsp ",
beforesend:function (Request) {
},
success:function (data, ajaxoptions, XHR) {
Mymodules. Module1.debug ("READ SUCCESS");
Alert (data)
,
error:function (XHR, ajaxoptions, thrownerror) {
mymodules. Module1.debug ("READ FAILED");
Alert (Json.stringify (XHR));
Alert (Json.stringify (ajaxoptions));
Alert (Json.stringify (Thrownerror));
}
);
Wireshark Monitoring log:
iget/app1/test/index2.jsp?_=1476917522183 http/1.1
host:www.mdm.springworks.info:8081
Connection: Keep-alive
Accept: */*
origin:file://
user-agent:mozilla/5.0 (Linux; Android 5.0.2; REDMI Note 3 build/lrx22g; WV) applewebkit/537.36 (khtml, like Gecko) version/4.0 chrome/45.0.2454.95 Mobile safari/537.36
accept-encoding: gzip, deflate
accept-language:zh-cn,en-us;q=0.8
x-requested-with:com.mycompany.logon
http/1.1 403 Forbidden
content-type:text/html;charset=utf-8
content-language:en
content-length:1009
Date : Wed, Oct 22:52:01 GMT
Server:sap
=========================
Code:
Test1:function () {
$.ajax ({
headers: {
' x-smp-appcid ': "C940cb2f-fef4-49d3-81e6-736273019fb4"
},
type: "GET",
cache:false,
URL: "http://smp.springworks.info:8081/app1/test/index2.jsp",
Beforesend:function (Request) {
},
success:function (data, ajaxoptions, XHR) {
mymodules. Module1.debug ("READ SUCCESS");
Alert (data)
,
error:function (XHR, ajaxoptions, thrownerror) {
mymodules. Module1.debug ("READ FAILED");
Alert (Json.stringify (XHR));
Alert (Json.stringify (ajaxoptions));
Alert (Json.stringify (Thrownerror));
}
);
SMP Wireshak Monitoring logs:
options/app1/test/index2.jsp?_=1476917672878 http/1.1 host:smp.springworks.info:8081 Connection:keep-alive access-control-request-method:get origin:file://user-agent:mozilla/5.0 (Linux; Android 5.0.2; REDMI Note 3 build/lrx22g;
WV) applewebkit/537.36 (khtml, like Gecko) version/4.0 chrome/45.0.2454.95 Mobile safari/537.36 Access-control-request-headers:accept, X-smp-appcid Accept: */* accept-encoding:gzip, deflate ACCEPT-LANGUAGE:ZH-CN,
en-us;q=0.8 X-requested-with:com.mycompany.logon http/1.1 403 Forbidden content-type:text/html;charset=utf-8 Content-language:en content-length:1009 date:wed, Oct 22:54:32 GMT server:sap