09-09-2015 11:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-09-2015 11:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Can anyone plese help? I have been trying to get this post code to work for two weeks. Can someone have a look a tell me what I need to do in order to post to the fitbit api? Thanks in advance.
urlworkout = "https://api.fitbit.com/1/user/-/body/log/weight.json";
string postData = String.Format("weight={0}&date={1}", "69.99", "2015-08-13");
byte[] bytedata = Encoding.UTF8.GetBytes(postData);
HttpWebRequest request2 = (HttpWebRequest)WebRequest.Create(urlworkout);
request2.Method = "POST";
request2.Headers["Authorization"] = "Bearer " + responseString; //This is the access token
request2.ContentLength = bytedata.Length;
request2.ContentType = "application/x-www-form-urlencoded";
Stream requestStream = request2.GetRequestStream();
requestStream.Write(bytedata, 0, bytedata.Length);
requestStream.Close();

09-13-2015 09:02
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-13-2015 09:02
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Out of curious, did you get 404 response?

09-14-2015 08:07
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-14-2015 08:07
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

