mayur pandit

mayur pandit

  • 1.4k
  • 336
  • 61.5k

Request.Headers.Host.ToString() getting null after deployment in serve

Jul 13 2022 12:52 PM

Hi all,

I have using "Request.Headers.Host.ToString(); " to get application url in api controller. It's working fine in my local system. but after publish my mvc web app in production it's getting always null. Kindly help me it's urgent.

string url = Request.Headers.Host.ToString(); 

Thanks.


Answers (1)