Click here to Skip to main content
15,922,894 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi I need to read the contents of a web-page where I need to login first with my credentials.On the home page I need to collect some data.Again that page needs to be refreshed after every 10 seconds.
But everytime I am trying to do,I am getting the error:The remote server returned an error: (400) Bad Request.

Can I get some better code to do this?

To clarify my requirements, let's say in I need to read the cricket scorefrom the rediff's sports page which gets updated from time to time.But whenever I am trying to access the contents of that page, I am getting the above mentioned error.

Kindly helpwith some code.
Posted

You can use its RSS feed to get cricket score or you can use its API so based on it you can get data every 10 second!! Make sure for this 10 second interval you have to implement functionality via Ajax call . For example http://www.rediff.com/rss/index.html . On this page you can get RSS feed and now make its api call like

Uri targetUri = new Uri(sBlogUrl);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(targetUri);
WebResponse webResponse = request.GetResponse();

here you will get de-serialize xml feeds and you have to convert them into serialize form.
 
Share this answer
 
it does fine the source may be it redirect to other page and give the 404 or 400 error. u write any code in web.confile file about to 404 error then remove that.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900