string url = "refresh_token=" + rtoken;
url += "&client_id=XXX;
url += "&client_secret=XXX";
url += "&grant_type=refresh_token";
byte[] data = Encoding.ASCII.GetBytes(url);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
Stream stream;
using (stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
string responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
No matter what I do the responseString is "{\"error\":\"invalid_code\"}"