Answer the question
In order to leave comments, you need to log in
Parsing json in C# (request in VK API). Where is the error?
You need to parse the ID's of the user's friends.
We get a stream.
private Stream GetRequest(string url)
{
var request = HttpWebRequest.Create(url);
var WebResponse = request.GetResponse();
Stream stream = WebResponse.GetResponseStream();
return stream;
}
public class Response
{
public int count { get; set; }
public List<int> items { get; set; }
}
string DeserStr = "";
using (StreamReader str = new StreamReader(GetRequest(requestURL)))
{
DeserStr = str.ReadToEnd();
}
Response respons = JsonConvert.DeserializeObject<Response>(DeserStr);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question