首页 > 解决方案 > Perl SOAP::LITE — 如何添加 http 请求头

问题描述

我有一个应用程序,想在其中添加 http 标头(不是肥皂标头),但无法弄清楚,任何可以提供帮助的人。

标签: perlsoaplite

解决方案


我必须使用以下代码设置 http 请求标头:

    my $transport = $service->transport;
    my $http_request = $transport->http_request;
    $http_request->header('x-api-key' => 'xaefdsfse' );
    $http_request->header('Content-Type' => 'application/soap+xml' );

在肥皂调用之前添加此代码。


推荐阅读