2

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
Guy
  • 62,854
  • 93
  • 248
  • 316

1 Answers1

4

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.

Community
  • 1
  • 1
John Saunders
  • 159,224
  • 26
  • 237
  • 393