I have an Json string which is receiveCount({\"url\":\"http://www.google.com\",\"count\":75108})
My complete Method is
public void GetPinCount(string url)
{
string QUrl = "https://api.pinterest.com/v1/urls/count.json?callback=receiveCount&url=" + url;
System.Net.HttpWebRequest Request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(QUrl);
Request.ContentType = "text/json";
Request.Timeout = 10000;
Request.Method = "GET";
string content;
using (WebResponse myResponse = Request.GetResponse())
{
using (System.IO.StreamReader sr = new System.IO.StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8))
{
content = sr.ReadToEnd();
}
};
var json = JObject.Parse(content);
var share_count = json["receiveCount"]["count"].ToString();
Console.WriteLine("Share Count :" + share_count);
}
When I am trying to access the count i am getting an exception like
Unexpected character encountered while parsing value: r. Path '', line 0, position 0.
Please tell me how this can be done.