RESTfulService.getRequestHeaders

Returns all of the HTTP request headers as a JavaScript object Further documentation.

Javascript example:

 var headers = form.rest.getHeaders();
 
 var contentType = headers["Content-Type"];
 if(contentType == "application/json")
 {
    //parse json
 }
 ...
 

returns java.util.Map