Skip to content

requests are sent without content-type header #297

Description

@ththvseo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions