`@HttpGet
global static List getAccounts() {
List accounts = [select id, name from Account];
System.debug(JSON.serialize(accounts).length());
return accounts;
}`
The above code just does JSON serialisation that SF is going to do instantly, but does it in advance and records it out to the debug log. It’s a bit inefficient and only for casual checking
Realistically, I would use Snuggle from the control range as recorded here:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_rest_code_sample_basic.htm