Home All Groups Group Topic Archive Search About

The remote server returned an error: (403) Forbidden in webrequest

Author
12 Oct 2006 12:13 PM
trialproduct2004
Hi all,

I am using webrequest and webresponse to chekc validation of url.

while validating url if i open that url in IE it is working properly
but through code it is showing error as shown in subject linke.

can anyone help me in solving this problem.

Please help me asap.

thanks in advance.

Author
12 Oct 2006 6:38 PM
Claus Konrad
One reason:
1) when using IE, you present your windows credentials
2) when using code - you do not set your current credentials to the
webrequest object?

/Claus Konrad


Show quoteHide quote
"trialproduct2***@yahoo.com" wrote:

> Hi all,
>
> I am using webrequest and webresponse to chekc validation of url.
>
> while validating url if i open that url in IE it is working properly
> but through code it is showing error as shown in subject linke.
>
> can anyone help me in solving this problem.
>
> Please help me asap.
>
> thanks in advance.
>
>
Author
12 Oct 2006 11:16 PM
Nathan Smith
Did you try setting the credentials to DefaultCredentials before issuing
the request?

-----Original Message-----
From: Claus Konrad [mailto:ClausKon***@discussions.microsoft.com]
Posted At: Thursday, October 12, 2006 11:38 AM
Posted To: microsoft.public.dotnet.security
Conversation: The remote server returned an error: (403) Forbidden in
webrequest
Subject: RE: The remote server returned an error: (403) Forbidden in
webrequest

One reason:
1) when using IE, you present your windows credentials
2) when using code - you do not set your current credentials to the
webrequest object?

/Claus Konrad


Show quoteHide quote
"trialproduct2***@yahoo.com" wrote:

> Hi all,
>
> I am using webrequest and webresponse to chekc validation of url.
>
> while validating url if i open that url in IE it is working properly
> but through code it is showing error as shown in subject linke.
>
> can anyone help me in solving this problem.
>
> Please help me asap.
>
> thanks in advance.
>
>
Author
13 Oct 2006 5:59 AM
trialproduct2004
Hi,

thanks for your reply.

I tried by setting defaultcredential, but still same error is coming.

Is there any other way which i can try?

Thanks