code: public static UrlEncodedContent getContent(HttpRequest request) {
      HttpContent content = request.getContent();
      if (content != null) {
        return (UrlEncodedContent) content;
      }
      UrlEncodedContent result = new UrlEncodedContent(new HashMap<String, Object>());
      request.setContent(result);
      return result;
    }
docs: Returns the URL-encoded content of the given HTTP request, or if none return and set as content
  a new instance of {@link UrlEncodedContent} (whose {@link #getData()} is an implementation of
  {@link Map}).
  
  @param request HTTP request
  @return URL-encoded content
  @throws ClassCastException if the HTTP request has a content defined that is not {@link
  UrlEncodedContent}
  @since 1.7