0

I am using HTTPWebRequest and HTTPWebResponse to get some data from a website using the API provided.

On HTTPResponse response.Headers["Link"] is see "https://xxx.com/api/v1/xxx?page=1&per_page=10". I wanted to loop through and get the data from the other pages e.g. page=2 etc. The maximum per_page=50. But, I have many more records on the other pages.

I have googled but no luck. I am not sure how to do this. Any direction will be greatly appreciated.

Thank you in advance.

satish
  • 59
  • 8
  • possible duplicate of [How to build a query string for a URL in C#?](http://stackoverflow.com/questions/829080/how-to-build-a-query-string-for-a-url-in-c) - which I believe is what you actually asking "how to properly replace `1` with other number in query string". – Alexei Levenkov Sep 12 '13 at 16:24
  • @AlexeiLevenkov Yes, Is there any simple way to do that? but, I dont know how many pages I can have. – satish Sep 13 '13 at 15:15
  • I built the query string using String builder. But, the API restricts only so many records per page on GET. So, after I get the response I have to loop for the next records. I am making any sense? Sorry, if it is bad question – satish Sep 13 '13 at 15:24
  • It would really help if you edit your post to actually add the question... Something like "here is my code to ... it does ... part. How to ... ?" At this point it is very unclear what you can and can't do (i.e. if you know of `for`/`while` loops). – Alexei Levenkov Sep 13 '13 at 15:53

0 Answers0