could you give us some details: What are you trying to do? Maybe a code sample?
In my experience the best way to interact with the rest api is with the esri objects, i.e. ArcGISFeatureLayer, that handles the queries, updates, deletes, credentials, etc. It also handles all the http connections...