params
로 값을 지정하면 URL access 로그 등에 정보가 노출되는 문제가 있다. POST시에 data
로 객체를 지정하면 JSON으로 전송한다.data
로 지정된 값을 x-www-form-urlencoded
로 보내려면 headers
와 transformRequest
지정이 필요하다.$http({ method: "POST", url: "/url/to/controller" headers: {'Content-Type': 'application/x-www-form-urlencoded'}, transformRequest: function(obj) { var str = []; for(var p in obj) str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); return str.join("&"); }, data: { "param1": "value1", "param2": "value2" } }).success()...