473,500 Members | 1,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Webrequest not working.

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
5 10833
* 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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2793
by: Stephane | last post by:
Hi, I'm trying to use PayPal and its Instant Payment Notification. In short, when a payment is made, PayPal send a post to my server and I post it back to PayPal. I'm using WebRequest to do...
3
1664
by: TR | last post by:
A company that lets affiliates search its database assumes that affiliates will paste code, which looks something like this, into their web pages: <form method="GET" name="search_5"...
4
7215
by: Terry | last post by:
Hello, I am trying to get a response for an .aspx page in my current project (same virtual directory) by using WebRequest.GetResponse but I keep getting a exception with "500 Internal server...
12
2847
by: ThyRock | last post by:
I am working on a WebRequest accessing the US Postal Service WebTools test API. This service uses a DLL file (ShippingAPITest.dll) with a query string which includes XML. The web service accepts...
5
3439
by: james.dixon | last post by:
Hi I have been struggling with what should be a simple thing. I want to crawl the web for specific links, and save any html and files that meet my criteria to my hard drive. I thought that...
1
4729
by: David Satz | last post by:
Hello--I just upgraded to Visual Studio .NET 2005 and suddenly, all my .NET 1.1 applications that accessed Web sites have broken. For example, this code: WebClient wc = new WebClient();...
6
9965
by: Jack | last post by:
I have a WebRequest object that I use to log into a site and then post some XML. In doing this I set the KeepAlive = true so that it maintains the connection and does operates undo the initial...
2
2949
by: Zytan | last post by:
I know that WebRequest.GetResponse can throw WebException from internet tutorials. However in the MSDN docs: http://msdn2.microsoft.com/en-us/library/system.net.webrequest.getresponse.aspx It...
3
8152
by: Dave | last post by:
string m_request = some_web_page; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(m_request ); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Which works...
4
2066
by: CindyH | last post by:
Hi I'm trying to use webrequest - webresponse to post a stream. I have set up a simple test with one aspx form holding the post code and trying to get another aspx form to receive the post on...
0
7134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7014
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7395
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5485
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4921
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3108
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
311
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.