* 아래와 같은 에러 발생 시
1 2 3 4 5 | { "error" : "Content-Type header [application/x-www-form-urlencoded] is not supported", "status" : 406 } | cs |
* curl 명령어에 옵션을 다음과 같이 추가하여 실행합니다.
1 2 | -H 'Content-Type: application/json' | cs |
: 추가 전
1 2 3 4 5 6 7 8 9 10 | $ curl -XPUT master:9200/customer/external/1?pretty -d' > { > "name": "John Doe" > } > ' { "error" : "Content-Type header [application/x-www-form-urlencoded] is not supported", "status" : 406 } | cs |
: 추가 후
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | $ curl -XPUT master:9200/customer/external/1?pretty -H'Content-Type: application/json' -d' > { > "name": "John Doe" > } > ' { "_index" : "customer", "_type" : "external", "_id" : "1", "_version" : 1, "result" : "created", "_shards" : { "total" : 2, "successful" : 2, "failed" : 0 }, "_seq_no" : 0, "_primary_term" : 1 } | cs |
* Elasticsearch 6.0 이후 버전에 도입된 엄격한 content-type 확인으로 인해서 추가해야 합니다.
'Open Source > elastic' 카테고리의 다른 글
windows 10 elasticsearch 설치 (0) | 2018.07.05 |
---|---|
[에러] [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] (0) | 2018.02.19 |
Elasticsearch 1.6.0 Multi Cluster 설치 및 환경 구축 (0) | 2018.02.13 |
Elasticsearch 1.6.0 Single Cluster 설치 및 환경 구축 (0) | 2018.02.13 |