Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 如何使用ajax获取响应头;把「;要求_Jquery_Ajax_Response Headers - Fatal编程技术网

Jquery 如何使用ajax获取响应头;把「;要求

Jquery 如何使用ajax获取响应头;把「;要求,jquery,ajax,response-headers,Jquery,Ajax,Response Headers,我正在发送ajax“PUT”请求,它也获得了成功,但是我没有得到任何响应,现在如果不使用响应数据,我已经得到了响应头的值,那么我如何获得这些值呢 $.ajax({ url:url, type:"PUT", data:blobData, contentType: false, processData: false, success:function(data, request,

我正在发送ajax“PUT”请求,它也获得了成功,但是我没有得到任何响应,现在如果不使用响应数据,我已经得到了响应头的值,那么我如何获得这些值呢

$.ajax({
          url:url,
          type:"PUT",
          data:blobData,
          contentType: false,
          processData: false,
          success:function(data, request, xhr){
            console.log("response headers..", xhr.getResponseHeader());
          },
          error:function(error){
            console.log(error);
          }
        });

xhr.getResponseHeader();这并没有给任何东西,只是我变得空虚了。但是在headers部分我可以看到响应头(在developer tool>network中),所以我可以忽略这些头的值。

如果您
console.log(xhr)
您找不到响应头上的路径/属性吗?在Response headers部分(在network