I've an object like
{
"Id": 1,
"Value": 10,
"UId" : "ab400"
}
How can I calculate the length of this so that I'm able to send it in ajax request.
$.ajax({
url: 'http://gdata.youtube.com/feeds/api/videos/keDZXXDxK1c/ratings',
type:"POST",
data: data,
headers: {
"Content-Type":"application/atom+xml",
"Content-Length": data.length,
I tried using stringfying the JSON but the length comes incorrect Tried : JSON.stringify(data).length