How to handle 302 status (Moved temporalily)

Posted by Vishalneeraj-24503 under ASP.NET on 3/23/2021 | Points: 10 | Views : 2661 | Status : [Member] [MVP] | Replies : 1
Hi All,

I have a requirement for rendering entire 3rd party website into our application.
To download data, we are using WebRequest class in-built Dot net library .
While downloading, status code shows 302 which means moved temporally.

Suppose for example, I am accessing ( https://abc.com/xyz.html file ) from our localhost/hosted application (IIS) and above link is different website. So here I am getting 302 status on browser console.

Kindly help me out how we can handle this status.




Responses

Posted by: Poster on: 3/25/2021 [Member] Starter | Points: 25

Up
0
Down
302 is temporary moved status code, that generally happens when the website doesn't have proper routing set. The possibility is that the target website is redirecting the request to some other page. Generally its very minor differences in the url. Check the target redirection of 302 and request the final destination from your application and it should work.

Vishalneeraj-24503, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response