本帖最后由 潘哆哩 于 2018-4-6 19:54 编辑
var headers={HTTP_INFO:'abc'};
api.ajax({
url: 'http://192.168.1.188/pin/index.php/Home/Api/headers.html',
method: 'post',
headers:headers
},function( ret, err ){
console.log(JSON.stringify(ret));
});
function headers(){
$server=I('server.');
$this->ajaxReturn($server);
}
返回的数据没有headers的数据
{"PATH":"C:\\ProgramData\\Oracle\\Java\\javapath;C:\\Program Files (x86)\\Intel\\iCLS Client\\;C:\\Program Files\\Intel\\iCLS Client\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\WINDOWS\\system32\\config\\systemprofile\\.dnx\\bin;C:\\Program Files\\Microsoft DNX\\Dnvm\\;C:\\Program Files\\Microsoft SQL Server\\130\\Tools\\Binn\\;d:\\Program Files (x86)\\Git\\cmd;D:\\Go\\bin;D:\\Program Files\\nodejs\\;C:\\WINDOWS\\system32\\config\\systemprofile\\AppData\\Local\\Microsoft\\WindowsApps","SYSTEMROOT":"C:\\WINDOWS","COMSPEC":"C:\\WINDOWS\\system32\\cmd.exe","PATHEXT":".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC","WINDIR":"C:\\WINDOWS","PHP_FCGI_MAX_REQUESTS":"1000","PHPRC":"D:/phpStudy/php/php-5.6.27-nts/","_FCGI_SHUTDOWN_EVENT_":"2112","PATH_TRANSLATED":"D:\\phpStudy\\WWW\\Home\\Api\\headers.html","PATH_INFO":"Api/headers","SCRIPT_NAME":"/pin/index.php","REQUEST_URI":"/pin/index.php/Home/Api/headers.html","QUERY_STRING":"","REQUEST_METHOD":"POST","SERVER_PROTOCOL":"HTTP/1.1","GATEWAY_INTERFACE":"CGI/1.1","REMOTE_PORT":"39655","SCRIPT_FILENAME":"D:/phpStudy/WWW/pin/index.php","SERVER_ADMIN":"admin@phpStudy.net","CONTEXT_DOCUMENT_ROOT":"D:/phpStudy/WWW","CONTEXT_PREFIX":"","REQUEST_SCHEME":"http","DOCUMENT_ROOT":"D:/phpStudy/WWW","REMOTE_ADDR":"192.168.1.102","SERVER_PORT":"80","SERVER_ADDR":"192.168.1.188","SERVER_NAME":"192.168.1.188","SERVER_SOFTWARE":"Apache/2.4.23 (Win32) OpenSSL/1.0.2j mod_fcgid/2.3.9","SERVER_SIGNATURE":"","SystemRoot":"C:\\WINDOWS","CONTENT_LENGTH":"0","HTTP_HOST":"192.168.1.188","CONTENT_TYPE":"application/x-www-form-urlencoded","HTTP_COOKIE":"PHPSESSID=u5mdrlbggierm2d670h9574d56","HTTP_ACCEPT_ENCODING":"gzip","HTTP_CONNECTION":"close","HTTP_USER_AGENT":"Mozilla/5.0 (Linux; Android 7.1.2; Redmi 4X Build/N2G47H; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.98 Mobile Safari/537.36","HTTP_ACCEPT":"*/*","HTTP_CHARSET":"UTF-8","FCGI_ROLE":"RESPONDER","PHP_SELF":"/pin/index.php/Home/Api/headers.html","REQUEST_TIME_FLOAT":"1523005300.6512","REQUEST_TIME":"1523005300"}