elasticSearch
curl -XPOST 'http://localhost:9200/classes/class/1/'
-d '{"title":"Algorithm", "professor":"John”}'
{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}curl: (6) Could not resolve host: professor
결론은, 6.0 버전부터 Rest Request에 ContentType checking이 엄격하게 들어가게 변화되었다.
이전에는 (6.0 이하) 콘텐츠 타입이 옵셔널이어여서 누락되거나 인식되지 않게되었다. 그 몫은 고스란히 서버에서 처리되어야하는 경우로 남게된것이다.
6.0부터는 그런일이 일절 발생하지 않도록 콜자체에 content-type을 명확하게 입력해야 하게 되었다.
물론 http.content_type.required
configuration을 통해 위의 사항을 선택할 수 있다. 그러나 기본값은 TRUE 이다
curl -XPOST http://localhost:9200/test/hi -H 'Content-Type: application/json' -d '{"title":"bca","professor":"john”}'