Skip to content

Low Level Rest Client shows successful response bad request with empty response #28923

@kevcodez

Description

@kevcodez

Using the AWS Elasticsearch Service with the latest possible version (6.0.1) deployed.

When doing basic requests like an index check using HEAD /<indexname> I am getting a response with status code 400 and an empty response body. The request works fine with a basic HTTP Client.

I was unable to produce this locally. This seems to be an issue in the low level REST Client.

Elasticsearch version 6.0.1

@Bean
open fun elasticsearchLowClient(): RestClient {
    return RestClient.builder(
        HttpHost(elasticsearchHost, elasticsearchPort, elasticsearchProtocol)
    ).build()
}
val indexExistsResponse = elasticsearchLowClient.performRequest("HEAD", index, mapOf()) // <- 400 empty response

if (indexExistsResponse.statusLine.statusCode == 404) {
    elasticsearchLowClient.performRequest(
            "PUT", index, hashMapOf(),
            StringEntity("...valid", ContentType.APPLICATION_JSON)
    )

}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions