Getting raw HTTP Data (Headers, Cookies, etc) in Google Cloud Endpoints

Add an HttpServletRequest parameter to your endpoint method, e.g.

@ApiMethod
public MyResponse getResponse( HttpServletRequest req, @Named("infoId") String infoId ) {
    // Use 'req' as you would in a servlet, e.g.
    String ipAddress = req.getRemoteAddr();
    ...
}