Sending json data in titanium

var blogPost = {
    title: 'My awesome blog',
    body: 'Today I met Susy at the laundromat. Best day EVAR\!'
};
 
var xhr = Ti.Network.createHTTPClient({
    onload: function() {
        // handle the response
    }
});
 
// optional:
// blogPost = JSON.stringify(blogPost);
xhr.send(blogPost);

How to calculate the width and height of label which is dynamic type in titanium?

Here is the sample code for label:

var label = Titanium.UI.createLabel({
    text: 'Sample Text',
    width: 'auto'
});
-------------------------------------------------------------
To calculate width of above type of label use this code:
var width = label.toImage().width;

Similarly, Height of label can also be found as:
var height = label.toImage().height;
--------------------------------------------------------------