Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl SOAP::LITE — How to add http request header

Tags:

perl

soaplite

I have an application and want to add http header(not soap header) to it, but can not figure it out, anyone out there who can help.

like image 637
Huang_Hai_Feng Avatar asked Jan 23 '26 21:01

Huang_Hai_Feng


1 Answers

I've got to set http request header using below code:

    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' );

Add this code before soap call.

like image 173
Huang_Hai_Feng Avatar answered Jan 25 '26 21:01

Huang_Hai_Feng



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!