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

Should set Content-Type to application/json #400

Closed
jordansissel opened this issue Feb 6, 2017 · 0 comments
Closed

Should set Content-Type to application/json #400

jordansissel opened this issue Feb 6, 2017 · 0 comments

Comments

@jordansissel
Copy link

>> client = Elasticsearch::Client.new
>> client.index(index: "foo", type: "OK", body: {})
% nc -l 9200
POST /foo/OK HTTP/1.1
User-Agent: Faraday v0.11.0
Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept: */*
Connection: close
Host: localhost:9200
Content-Length: 2
Content-Type: application/x-www-form-urlencoded

Expected Content-Type: application/json

@karmi karmi closed this as completed in 76f8679 Feb 7, 2017
karmi added a commit that referenced this issue Feb 7, 2017
…' header

In future, Elasticsearch will require specifying the format of data which is being sent
 (eg. when indexing a document). Current versions of Elasticsearch will start to
 print a warning to the deprecation log.

 A default value 'application/json' for the 'Content-Type' header has been added
 to prevent the deprecation messages and to be prepared for the requirement in
 next major version of Elasticsearch.

 See: elastic/elasticsearch#22691

Related:

* c22ec89
* logstash-plugins/logstash-input-elasticsearch#55
* logstash-plugins/logstash-input-elasticsearch#56
* elastic/elasticsearch#22691

Closes #400
karmi added a commit that referenced this issue Feb 7, 2017
…nticore adapter

The Manticore adapter doesn't handle the `transport_options` in the same way
as the Faraday and Curb adapters.

The addition of a default 'Content-Type' header in 76f8679
(#400) didn't work then, and this patch fixes it.

Related:

    * #400
    * logstash-plugins/logstash-input-elasticsearch#55
    * logstash-plugins/logstash-input-elasticsearch#56
karmi added a commit that referenced this issue Feb 7, 2017
…nticore adapter

The Manticore adapter doesn't handle the `transport_options` in the same way
as the Faraday and Curb adapters.

The addition of a default 'Content-Type' header in 76f8679
(#400) didn't work then, and this patch fixes it.

Related:

    * #400
    * logstash-plugins/logstash-input-elasticsearch#55
    * logstash-plugins/logstash-input-elasticsearch#56
mthssdrbrg added a commit to mthssdrbrg/fluent-plugin-elasticsearch that referenced this issue Apr 13, 2017
Starting with Elasticsearch 5.3, rest requests without an explicit
Content-Type are deprecated and it'll log a warning for every request
that is sent without a Content-Type header.

I addressed this in a similar manner to how `elasticsearch-ruby` did,
see [1], [2].

[1]: elastic/elasticsearch-ruby#400
[2]: elastic/elasticsearch-ruby@76f8679
picandocodigo pushed a commit to elastic/elastic-transport-ruby that referenced this issue Jun 7, 2021
…nticore adapter

The Manticore adapter doesn't handle the `transport_options` in the same way
as the Faraday and Curb adapters.

The addition of a default 'Content-Type' header in 76f86793cde0a0e7e816a743c73f69002a53483e
(#400) didn't work then, and this patch fixes it.

Related:

    * elastic/elasticsearch-ruby#400
    * logstash-plugins/logstash-input-elasticsearch#55
    * logstash-plugins/logstash-input-elasticsearch#56
renaperes824 added a commit to renaperes824/ruby-elastic-transport that referenced this issue Sep 12, 2022
…nticore adapter

The Manticore adapter doesn't handle the `transport_options` in the same way
as the Faraday and Curb adapters.

The addition of a default 'Content-Type' header in 76f86793cde0a0e7e816a743c73f69002a53483e
(#400) didn't work then, and this patch fixes it.

Related:

    * elastic/elasticsearch-ruby#400
    * logstash-plugins/logstash-input-elasticsearch#55
    * logstash-plugins/logstash-input-elasticsearch#56
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

1 participant