如何获取SoapClient使用的http请求标头? [英] How to get http request headers used by SoapClient?
问题描述
我想检查通过 SoapClient 发送的http标头。
I want to check my http headers that are sent via a SoapClient.
然而它只提供快速获取肥皂头的功能:
Yet it only offers quick functions to fetch the Soap headers:
/**
* Returns the SOAP headers from the last request
* @link http://php.net/manual/en/soapclient.getlastrequestheaders.php
* @return string The last SOAP request headers.
* @since 5.0.1
*/
public function __getLastRequestHeaders () {}
我对这些不感兴趣。
如何在HTTP级别找出用于请求的http标头?
How can I find out what http headers have been used for the request on the HTTP level?
Xdebug在 _call
中丢失了上下文,客户端似乎无法自己获取该信息。
Xdebug loses context at the _call
and the client doesn't seem able to to fetch that information by itself.
如何进行?
推荐答案
我最终使用Wireshark。我将我的SoapClient配置为仅针对我的本地IP发布,对我来说是10.49.57.28。
I ended up using Wireshark. I configured my SoapClient to just post against my local IP, for me that was 10.49.57.28.
我捕获了任何
interface。
I captured the any
interface.
首先我必须通过以下方式启用协议:Ctrl + Shift + E.我选择了全部启用。
First I had to enable the protocols via: Ctrl + Shift + E. I selected "Enable All".
我使用过滤器:
http.request.method == "POST" and ip.addr == 10.49.57.28
我右键点击相关请求并使用:
I right clicked the relevant request and used:
关注> TCP流
我收到了所有相关的请求信息:
And there I had all the relevant request information:
POST / HTTP/1.1
Host: 10.49.57.28
Accept: */*
Accept-Encoding: deflate, gzip
SOAPAction: ""
Content-Type: text/xml; charset=utf-8
Content-Length: 2085
Expect: 100-continue
HTTP/1.1 100 Continue
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope ...
当然,回复将是错误,但我对此并不感兴趣。
Of course, the response will be an error, yet I wasn't interested in that.
这篇关于如何获取SoapClient使用的http请求标头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!