Skip to content

Using the format=json uri parameter with cat api calls fails #4243

Closed
@CraigWh

Description

@CraigWh

NEST/Elasticsearch.Net version: 7.2.1

Elasticsearch version: 7.2.1

Description of the problem including expected versus actual behavior: Using the Cat.MasterAsync API and specifying the Format="JSON" parameter returns a response object that has the Success flag set to false but has a status code of 200 and the correct response body. Calling the same method in Elasticsearch.Net 6.8 worked as expected.

I am calling the API like this (this.client is of type IElasticLowLevelClient):

await this.client.Cat.MasterAsync<StringResponse>(new CatMasterRequestParameters { Format = "JSON" });

Provide ConnectionSettings (if relevant):
Using a SingleNodeConnectionPool
Specifying DisableAutomaticProxyDetection and DisablePing

Provide DebugInformation (if relevant):

# Audit trail of this API call:
 - [1] BadResponse: Node: http://localhost:9200/ Took: 00:00:00.0312765
# OriginalException: Elasticsearch.Net.ElasticsearchClientException: Request failed to execute. Call: Status code 200 from: GET /_cat/master?format=json
# Request:
<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>
# Response:
[{\"id\":\"nodeId\",\"host\":\"hostName\",\"ip\":\"ipaddress\",\"node\":\"nodeName\"}]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions