1
Answer

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

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)