본문 바로가기
메모./ElasticSearch

curl: (6) Could not resolve host: application #ElasticSearch 8.3.3

by 낭람._. 2022. 8. 8.
반응형
>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" 해결하기.

반응형

댓글