Huang_Hai_Feng
Huang_Hai_Feng

Reputation: 287

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

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.

Upvotes: 3

Views: 536

Answers (1)

Huang_Hai_Feng
Huang_Hai_Feng

Reputation: 287

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.

Upvotes: 3

Related Questions