Akash Sinha
Akash Sinha

Reputation: 29

Adding From Header Field HTTP POST Header in Gsoap

I am using g-soap-2.8 to send a post request to a web service. But the problem is that the web service requires From (Http Header Field) must be present in Header. But gsoap has no context related to From header field.

Can anyone explain how to add this particular header field-value pair in gsoap.

Upvotes: 2

Views: 1340

Answers (2)

Dr. Alex RE
Dr. Alex RE

Reputation: 1708

The soap.http_extra_header string can be used for this:

soap->http_extra_header = "SomeField: SomeValue(s)";

You can add multiple extra HTTP headers by separating them with \r\n in the string. Set this string before making the call. The string will be reset to NULL when the call completes, so the extra headers do no accidentally bleed into the next calls.

Upvotes: 1

ssemilla
ssemilla

Reputation: 3970

You can try to set the soap struct field proxy_from. e.g.

soap.proxy_from = "FROM_YOU";

Upvotes: 0

Related Questions