How to use cursors to iterate through result set of GET followers/list using c#?


I have been trying a way to get the data in the next page of the result set of GET followers/list API call. I can get the default data set with the data of first 20 followers and not the others. To get the data of other followers i have to access the next page using the next_cursor but it’s not working. I tried using the pseudo-code mentioned in this link.

Is it a must to use this:
api-path, “

Because i have been using the resource url as,
var resource_url = “”;

and i tried appending the next_cursor to the same resource url.
var url_with_cursor = resource_url + “&cursor=” + 1463101490306580067;

and then created the request.
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url_with_cursor);

but i’m getting an exception in this line when getting the response.
WebResponse response = request.GetResponse();

Can someone tell the exact way to do cursoring. Thanks.


You should keep the parameters you gave to the endpoint when you got that cursor. So the URL should be of the form, not
targetuser is of course the user you are interested in. It would be of the form if you use a user id to identify the user.