0

I want to get url referer var referer = Request.Headers["Referer"].
I already used this in my other projects, but this time there is no such header there. Maybe i should add something to Configure method, but i can't find any info about it.

1
  • Referer is not required; maybe it's just not there for the request(s) you're using it on? Commented May 18, 2020 at 6:03

2 Answers 2

1

You are almost there. Try this:

string referer = Request.Headers["Referer"].ToString();
Sign up to request clarification or add additional context in comments.

Comments

1

I had a similar problem: I found in a old stackoverflow post 2010 that the referer is not set unless a link button is clicked return redirect('...') only provided a blank value. In my case I had to have the sending app use a special html page with a href clicked by a javascript when page was loading. Tested and working. Just wanted to help clarify this issue. Hope this helps someone.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.