|
沙发

楼主 |
发表于 2020-2-6 22:48:34
|
只看该作者
代码:
- function callScript( )
- {
- $response=new xajaxResponse();
- $value2="this is a string";
- $response->call( "myJSFunction", "arg1", 9432.12, array
- (
- "myKey" => "some value",
- "key2" => $value2
- ));
- return $response;
- }
复制代码
monitor80过程:
- POST /xajax/tests/callScriptTest.php HTTP/1.1
- Host: 192.168.21.128
- Connection: keep-alive
- Content-Length: 36
- Cache-Control: max-age=0
- Origin: http://192.168.21.128
- If-Modified-Since: Sat, 1 Jan 2000 00:00:00 GMT
- User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
- content-type: application/x-www-form-urlencoded
- Accept: */*
- Referer: http://192.168.21.128/xajax/tests/callScriptTest.php
- Accept-Encoding: gzip, deflate
- Accept-Language: zh-CN,zh;q=0.9
- xjxfun=callScript&xjxr=1580999591996
复制代码
返回:
- HTTP/1.1 200 OK
- Date: Thu, 06 Feb 2020 14:33:12 GMT
- Server: Apache/2.4.27 (Win32) PHP/5.6.31
- X-Powered-By: PHP/5.6.31
- Content-Length: 287
- Keep-Alive: timeout=5, max=100
- Connection: Keep-Alive
- Content-Type: text/xml ; charset="utf-8"
- <?xml version="1.0" encoding="utf-8" ?>
- <xjx><cmd cmd="jc" func="myJSFunction">
- <xjxobj>
- <e><k>N0</k><v>Sarg1</v></e>
- <e><k>N1</k><v>N9432.12</v></e>
- <e><k>N2</k><v>
- <xjxobj>
- <e><k>SmyKey</k><v>Ssome value</v></e>
- <e><k>Skey2</k><v>Sthis is a string</v></e>
- </xjxobj></v>
- </e>
- </xjxobj>
- </cmd></xjx>
复制代码
|
|