如何在 Erlang 中发送带有集合 http_header 的请求 打包一个 SOAP github 包
How to send request with a set http_header in Erlang Package a SOAP github package
我正在使用这个erlang-package on Github to work with WSDL and SOAP,而且我只使用生成客户端的包!我根本没有 erlang 知识——只有基本的长生不老药。
我的问题:
How can I send a request with an authorization header?
假设测试我的服务的代码如下所示:
connectionCheck() ->
'WsdlService_client':connectionCheck(
#'P:connectionCheck'{
clientSoftwareKennung = "Elixir"},
_Soap_headers = [],
_Soap_options = [{url,"http://localhost:8091/myservice/v2.0/connectionCheck"}]).
结果http-request
中需要如下header时需要填写哪个参数,参数是什么样子的http-request
?
Authorization: Basic <placeholder encodeded user password>
谢谢!
我自己解决了
如果您需要将一些 http-Headers 传递给您的 Soap-Request,您可以这样做:
_Soap_options = [{url,"http://localhost:8091/myservice/v2.0/connectionCheck"},{http_headers, [{"Authorization","Basic Encoded User-Pass"}]}]).
我正在使用这个erlang-package on Github to work with WSDL and SOAP,而且我只使用生成客户端的包!我根本没有 erlang 知识——只有基本的长生不老药。
我的问题:
How can I send a request with an authorization header?
假设测试我的服务的代码如下所示:
connectionCheck() ->
'WsdlService_client':connectionCheck(
#'P:connectionCheck'{
clientSoftwareKennung = "Elixir"},
_Soap_headers = [],
_Soap_options = [{url,"http://localhost:8091/myservice/v2.0/connectionCheck"}]).
结果http-request
中需要如下header时需要填写哪个参数,参数是什么样子的http-request
?
Authorization: Basic <placeholder encodeded user password>
谢谢!
我自己解决了
如果您需要将一些 http-Headers 传递给您的 Soap-Request,您可以这样做:
_Soap_options = [{url,"http://localhost:8091/myservice/v2.0/connectionCheck"},{http_headers, [{"Authorization","Basic Encoded User-Pass"}]}]).