Getting HttpWebRequest to behave as a link clicked

  • Thread starter Thread starter Andres N
  • Start date Start date
A

Andres N

Could anyone please explain why this link
http://www.earningswhispers.com/stocks.asp?symbol=msft
opens fine when it's clicked as a LINK on some other page, but will
get redirected when I try to open it DIRECTLY from browser's address
bar, or when I try to request it with HttpWebRequest?

And how could I emulate this LINK behavior (i.e without being
redirected) with HttpWebRequest or something else in C# (if it's
possible at all)?

I've also prepared tinyurl to show how is it working as LINK:
http://preview.tinyurl.com/yjqghkl

Thanks!
Andres
 
Andres said:
Could anyone please explain why this link
http://www.earningswhispers.com/stocks.asp?symbol=msft
opens fine when it's clicked as a LINK on some other page, but will
get redirected when I try to open it DIRECTLY from browser's address
bar, or when I try to request it with HttpWebRequest?

This is barely a .NET question, never mind a C# question. If you really
want a good, detailed, and correct answer, you should find a more
appropriate forum for your question.

The answer surely will be found in the specific headers included in the
HTTP request sent to the HTTP server. Based on your description, sounds
like having a non-blank referrer might be important (see the
HttpWebRequest.Referer property).

But it's really something you should just take a look at yourself and
track down based on the data you observe. The bottom line is that the
only thing that can control what's sent back from the HTTP server is the
data that's sent to the HTTP server itself. So if you see a difference
in behavior, it must be in that data somewhere.

Pete
 
Andres said:
Thanks Pete!

And sorry for posting to the wrong group, didn't mean to.

That's okay. It's not so much a hardship for the newsgroup, as it is a
potentially poor way to receive a really good answer (i.e. it hurts you
more than anyone else).
 
Back
Top