IT/Elasticsearch
[Elasticsearch] -H 'Content-Type: application/json'
DreamKiHyun
2018. 3. 9. 17:16
5.5.0 이상 버전에서 아래와 같은 에러 발생 시
{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}
커맨드 끝에 아래처럼 타입을 설정해줘야한다. (불편불편...)
-H 'Content-Type: application/json'
Example)
curl -XPUT '11.123.45.67:9200/myindex/_settings' -d '{ "index" : {
"number_of_replicas" : 0
}
}' -H 'Content-Type: application/json