1

I've been trying to access a web service using System.Net.WebRequest to make a GET request. This would return a "504 Gateway timeout" error.

However the same web service would return data successfully when accessed through a browser.

After comparing the request headers of the WebRequest and Browser requests I identified that the header "Accept-Language" had to be present even if the value of it was empty.

Any ideas as to why "Accept-Language" has to be present?

skaffman
  • 398,947
  • 96
  • 818
  • 769
Castrohenge
  • 8,525
  • 5
  • 39
  • 66

1 Answers1

0

The service -- and it would perhaps help to know what it is -- most likely returns dates or text or other information that needs to be localized.

Without the Accept-Language header it's not possible to do this.

Jeremy McGee
  • 24,842
  • 10
  • 63
  • 95