如何在Erlang包中使用set http_header发送请求SOAP github包

问题描述 投票:1回答:1

我正在使用这个erlang-package on Github to work with WSDL and SOAP,我只使用客户端生成的包!我根本没有知识 - 只有基本的灵药。

我的问题:

如何使用授权标头发送请求?

让我们说测试我的服务的代码如下所示:

connectionCheck() ->

    'WsdlService_client':connectionCheck(
        #'P:connectionCheck'{
            clientSoftwareKennung = "Elixir"},
    _Soap_headers = [],
    _Soap_options = [{url,"http://localhost:8091/myservice/v2.0/connectionCheck"}]).

当我需要在生成的http-request中使用以下标题时,需要填写哪个参数以及参数是什么样的?

Authorization: Basic <placeholder encodeded user password>

谢谢!

soap wsdl erlang elixir
1个回答
0
投票

我能够自己解决它。

如果你需要将一些http-Headers传递给你的Soap-Request,你可以这样做:

_Soap_options = [{url,"http://localhost:8091/myservice/v2.0/connectionCheck"},{http_headers, [{"Authorization","Basic Encoded User-Pass"}]}]).
© www.soinside.com 2019 - 2024. All rights reserved.