AlexIoannides / elasticsearchr

Lightweight Elasticsearch client for R.
https://alexioannides.com/2016/11/28/elasticsearchr-a-lightweight-elasticsearch-client-for-r/
54 stars 19 forks source link

ES 6 Content-Type header [] is not supported #30

Closed jmrichardson closed 6 years ago

jmrichardson commented 6 years ago

With ES6, I receive the following error when sending a query with elasticsearchr:

"error": "Content-Type header [] is not supported",
"status": 406

Apparently ES6 has Strict Content-Type Checking for Elasticsearch REST Requests

AlexIoannides commented 6 years ago

Thanks for pointing this out - I'll take a look ASAP.

jmrichardson commented 6 years ago

If it saves you any time, I forked and modified the utils.R to add headers such as:

response <- httr::POST(rescource$search_url, body = api_call_payload, httr::add_headers("Content-Type" = "application/json"))

Here's my forked version of utlis.R

AlexIoannides commented 6 years ago

Thanks Jim - would you be so kind as to send a pull request with your changes?

If there's an issue please let me know and I'll do it manually.

AlexIoannides commented 6 years ago

This has been fixed in v0.2.1 that has been submitted to CRAN.