[Xml-compile] XML::Compile::Transport::SOAPHTTP_AnyEvent - can I modify modify HTTP headers

Roman Daniel roman.daniel at davosro.cz
Thu Nov 13 17:34:43 GMT 2014


Hi Mark,

I try to use asynchronous SOAPHTTP transport for XML::Compile::SOAP. I
would like to preset some HTTP headers (basic auth, ...), but I found it
hardly possible.

$guard = http_request $request->method => $request->uri
         , body    => $request->content
         , headers => $request->headers
         , $self->anyEventParams
         , $handler;

As you can see in code XML::Compile::Transport::SOAPHTTP_AnyEvent via
anyEventParams attribute you can only add more arguments to http_request
call you cannot change the headers.

Could it be possible to add an optional user_agent (ua?) parameter for
XML::Compile::Transport::SOAPHTTP_AnyEvent constructor. This parameter if
supplied would be an anonymous subroutine to be used to send the request
instead of AnyEvent::HTTP::http_request

my $ua = $self->{ua} || \&AnyEnvent::HTTP::http_request;
$guard = $ua->($request->method => $request->uri
         , body    => $request->content
         , headers => $request->headers
         , $self->anyEventParams
         , $handler);

Thanks for any reply,

Roman Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20141113/7c6caaa3/attachment.htm>


More information about the Xml-compile mailing list