반응형
>curl -X PUT "localhost:9200/user/_doc/1?pretty" -H 'Content-Type: application/json' -d'{"username":"nanglam"}'
{
"error" : "Content-Type header [application/x-www-form-urlencoded] is not supported",
"status" : 406
}
curl: (6) Could not resolve host: application
-H 'Content-Type: application/json'을 추가하고 실행하면 curl: (6) Could not resolve host: application 오류가 나온다.
>curl -X PUT "localhost:9200/user/_doc/1?pretty" -H 'Content-Type:application/json' -d'{"username":"nanglam"}'
{
"error" : "Content-Type header [application/x-www-form-urlencoded] is not supported",
"status" : 406
}
Content-Type:application/json 으로 하면 해당 오류는 사라진다.
Not Work : -H 'Content-Type: application/json'
Ok : -H 'Content-Type:application/json'
성공..?
"error" : "Content-Type header [ application/x-www-form-urlencoded] is not supported" 해결하기.
반응형
'메모. > ElasticSearch' 카테고리의 다른 글
Content-Type header [application... #ElasticSearch 8.3.3 (0) | 2022.08.09 |
---|---|
curl: (60) schannel: SEC_E_UNTRUSTED_ROOT #ElasticSearch 8.3.3 (2) | 2022.08.07 |
curl: (52) Empty reply from server #ElasticSearch 8.3.3 (2) | 2022.08.06 |
댓글