Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requests are sent without content-type header #297

Open
ththvseo opened this issue Dec 19, 2017 · 3 comments
Open

requests are sent without content-type header #297

ththvseo opened this issue Dec 19, 2017 · 3 comments

Comments

@ththvseo
Copy link

since ES 5.3, every request without content-type header triggers a warning.

Content type detection for rest requests is deprecated. Specify the content type using the [Content-Type] header.

just look at the competition's ticket here: olivere/elastic#511

there is currently no interface available to set the content-type (or other headers),
and no code that sets it.
(with one exception in SetBodyJson(): https://github.com/mattbaird/elastigo/blob/master/lib/request.go#L80 )

(a sub-issue is that the header is not set in SetBodyGzip() even when serializing json: #295 )

an expectation with a go library would be that it should be possible to inject a custom http.Client compatible client, which would allow overriding headers.

@inmylo
Copy link

inmylo commented Jan 31, 2018

With Elasticsearch 6.x elastigo searches don't work at all ! Error: Error [Content-Type header [] is not supported] Status [406] [406].

Please add a header or make it configurable.

@lindhor
Copy link

lindhor commented Feb 25, 2018

In Elasticsearch 6.x Content-Type header is required. https://www.elastic.co/blog/strict-content-type-checking-for-elasticsearch-rest-requests

@inmylo
Copy link

inmylo commented Feb 25, 2018

Don't bother, this project looks dead long time ago - check commits and closed issues history.
Move to https://github.com/olivere/elastic, or wait for official client

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants