Skip to content

Incorrect HTTP Method used when indexing documents with no ID inference #7057

Closed
@stevejgordon

Description

@stevejgordon

Elastic.Clients.Elasticsearch version: 8.0.0-rc.2, 8.0.0 and 8.0.1

Dynamic HttpMethod

Steps to reproduce:

  1. Index an object with no ID inference
public class Person
{
    public string? FirstName { get; init; }
}

var response = await client.IndexAsync(new Person { FirstName = "Steve" }, request => request.Index("product-index_001"));

Expected behavior
Expect the HttpMethod to be POST, as no ID is inferrable for the URL path.

Actual behavior
HttpMethod is PUT, which results in a 405 status code from the server for the URL path /product-index_001/_doc/

Metadata

Metadata

Assignees

No one assigned

    Labels

    8.xRelates to a 8.x client version

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions