Hi Amardeep
if you don't need to know the count call set oModel( ).setCountSupported( false )
else, take a look at the following method which i believe does the count.
sap.ui.model.odata.ODataListBinding.prototype._getLength
https://sapui5.hana.ondemand.com/sdk/resources/sap/ui/model/odata/ODataListBinding-dbg.js
the headers aren't included in the jQuery.ajax call, not sure why, they are in the request from the model if you need them.
you could extend the method (locally) in the list binding to include headers
eg.
jQuery.ajax({ url: oRequest.requestUri, async: oRequest.async, cache: this.oModel.bCache, headers: oRequest.headers, //add this line username: oRequest.user, password: oRequest.password, success: _handleSuccess, error: _handleError });
Cheers
John P