Fix createObject content lenght for String payloads. Add encoding parameter to createObject.