RestResponse.getHeaders

Returns the response headers as key-->value string pairs following a RestServices call The key-->value pairs are returned as a JavaScript object. Accessing a key value where the name of the key has a hyphen in it needs to be accessed using headers["key-name"] syntax.

Example:

 var response = services.rest.get("http://example.com/rest/users");
 var headers = response.getHeaders();
 var content = headers["Content-Type"];
 if(content == 'application/json')
 {
   //do something with JSON 
 }
 

returns java.util.Map