title: how to hide params in $http POST method
body: <p>how to hide params in $http post method . If i use data instead params as in given example , I have change nearly 400 server side request getters from request.getParameter("key") to request.getReader() ;
  I have a situation here . We are about to migrate from <code>request.getParameter</code> to <code>request.getReader</code> . 
  Reason : To remove form parameters from requet URL .</p>
  
  <p>from this : <code>http://localhost:8080/myApp/test.do?test1=abc&amp;test2=def</code></p>
  
  <p>to this :<code>http://localhost:8080/myApp/test.do</code></p>
  
  <p>here is what i have achieved  .
  sample request (old) :</p>
  
  <pre><code>            $scope.myJson = {
          'abc' : '123',
          'def' : '456',
      };
  
      $http({
  
          method : 'POST',
          url : 'test.do',
          param : {
              'test1' : $scope.myJson,
          },
          headers : {
              'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8'
          }
      }). success(function(data, status, headers, config) {
  
  
      }).
      error(function(data, status, headers, config) {
      });
  </code></pre>
  
  <p>sample request new</p>
  
  <pre><code>            $scope.myJson = {
          'abc' : '123',
          'def' : '456',
      };
  
      $http({
  
          method : 'POST',
          url : 'test.do',
          data: {
              'test1' : $scope.myJson,
          },
          headers : {
              'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8'
          }
      }). success(function(data, status, headers, config) {
  
  
      }).
      error(function(data, status, headers, config) {
      });
  </code></pre>
  
  <p>As You can see i have changed param to data .</p>
  
  <p>Server Side (old);</p>
  
  <pre><code>final String myJson= request.getParameter("test1");
  </code></pre>
  
  <p>Server Side (new) :</p>
  
  <pre><code>     StringBuffer jb = new StringBuffer();
        String line = null;
        try {
          BufferedReader reader = request.getReader();
          while ((line = reader.readLine()) != null)
            jb.append(line);
        } catch (Exception e) {
            e.printStackTrace();/*report an error*/ }
  
        try {
          JSONObject jsonObj = new JSONObject(jb.toString());
          JSONObject jsonObj1 =jsonObj.getJSONObject("test1");
          String test1= jsonObj1.toString();
      } catch (JSONException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }   
  </code></pre>
  
  <p>Is this the way to handle this scenerio ?We Have around 400+ services in application . Any Quick Workaround ?</p>
  
  <p>EDIT 1 :</p>
  
  <pre><code>public class myController extends AjaxBaseController {
  
  
      @Override
      public ModelAndView executeAjaxCall(final HttpServletRequest request, final HttpServletResponse response) {
  
  
          final String test1= request.getParameter("test1");               
  
          final InputParam loginParam = JsonUtil.convertPojo(test1,InputParam .class); // POJO class
  //other logics 
  
      };
  }
  </code></pre>