Guy
Guy

Reputation: 67340

How do I add an HTTP header to a web service call?

I'm calling a web service from a console app - all in C# on .NET.

I want to add an HTTP header (not a SOAP header) to the web service call. How do I do this?

This is what my code looks like so far:

EatService es = new EatService(); // web service added in Web References
// Add HTTP header X-Info = "extra info" here
string info = es.GetMoreInfo(); // ws call

Upvotes: 2

Views: 14858

Answers (1)

John Saunders
John Saunders

Reputation: 161791

If you are using an ASMX web service proxy (Web Reference), then this is a duplicate of Adding Custom Http Headers to C# Web Service Proxy.

Upvotes: 4

Related Questions