By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,213 Members | 1,517 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,213 IT Pros & Developers. It's quick & easy.

Webrequest not working.

P: n/a
Hi all,
I am having application which is validating URL's and checking whether
that URL is redirecting to some other URL at a time of opening or not.

My code looks like:-

WebRequest myWebRequest = WebRequest.Create(textBox1.Text);
response. myWebResponse = myWebRequest.GetResponse();
MssageBox.Show(myWebResponse.ResponseUri.ToString( ));

But sometimes i am getting error :-
The remote server returned an error: (500) Internal Server Error.
and
The remote server returned an error: (403) Forbidden.

But if i check that url in IE those URL's are opening properly but not
through above code.

Can someone tell me why this is happening.

Please help me asap.

thanks in advance.

May 11 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
* archana wrote:
Hi all,
I am having application which is validating URL's and checking whether
that URL is redirecting to some other URL at a time of opening or not.

My code looks like:-

WebRequest myWebRequest = WebRequest.Create(textBox1.Text);
response. myWebResponse = myWebRequest.GetResponse();
MssageBox.Show(myWebResponse.ResponseUri.ToString( ));

But sometimes i am getting error :-
The remote server returned an error: (500) Internal Server Error.
and
The remote server returned an error: (403) Forbidden.


http://www.checkupdown.com/status/E403.html
May 11 '06 #2

P: n/a
Hi,

thanks for ur reply.

If i try to browse that URL in IE6 it is opening properly but not
throuhg above code.

Can you tell me why this is happening.

Thanks

May 11 '06 #3

P: n/a
Thus wrote archana,
Hi all,
I am having application which is validating URL's and checking whether
that URL is redirecting to some other URL at a time of opening or not.
My code looks like:-

WebRequest myWebRequest = WebRequest.Create(textBox1.Text); response.
myWebResponse = myWebRequest.GetResponse();
MssageBox.Show(myWebResponse.ResponseUri.ToString( ));

But sometimes i am getting error :-
The remote server returned an error: (500) Internal Server Error.
and
The remote server returned an error: (403) Forbidden.
But if i check that url in IE those URL's are opening properly but not
through above code.

Can someone tell me why this is happening.


You neither pass any credentials nor do you specify some HTTP headers web
applications might try use, e.g. User-Agent to identify a client's browser
type.

Compare the HTTP requests sent by IE to your requests using Fiddler (www.fiddertool.com).

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
May 13 '06 #4

P: n/a
That url doesn't work for me.

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------

"Joerg Jooss" <ne********@joergjooss.de> wrote in message
news:94**************************@msnews.microsoft .com...
Thus wrote archana,
Hi all,
I am having application which is validating URL's and checking whether
that URL is redirecting to some other URL at a time of opening or not.
My code looks like:-

WebRequest myWebRequest = WebRequest.Create(textBox1.Text); response.
myWebResponse = myWebRequest.GetResponse();
MssageBox.Show(myWebResponse.ResponseUri.ToString( ));

But sometimes i am getting error :-
The remote server returned an error: (500) Internal Server Error.
and
The remote server returned an error: (403) Forbidden.
But if i check that url in IE those URL's are opening properly but not
through above code.

Can someone tell me why this is happening.


You neither pass any credentials nor do you specify some HTTP headers web
applications might try use, e.g. User-Agent to identify a client's browser
type.
Compare the HTTP requests sent by IE to your requests using Fiddler
(www.fiddertool.com).

Cheers,
--
Joerg Jooss
ne********@joergjooss.de

May 13 '06 #5

P: n/a
Thus wrote Alvin Bruney" www.lulu.com/owc,
That url doesn't work for me.


Typo...

http://www.fiddlertool.com/

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
May 13 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.