Skip to content

Cannot set RequestParameters anymore #8415

@gpetrou

Description

@gpetrou

Elastic.Clients.Elasticsearch version: 8.16.0

Elasticsearch version: 8.12.2

.NET runtime version: 8.0

Operating system version:

Description of the problem including expected versus actual behavior:
In previous versions, we were able to pass RequestParameters in ElasticsearchClient.Transport.RequestAsync method.
It seems that we cannot do that anymore. According to the release notes there were some changes to the Transport library, but once again, it is unclear what to do about them.

Steps to reproduce:

UpdateDocumentRequestParameters : RequestParameters
{
    public Refresh Refresh
    {
        get => Q<Refresh>("refresh");
        init => Q("refresh", value);
    }
}
UpdateDocumentRequestParameters updateDocumentRequestParameters = new()
{
    Refresh = refresh
};

StringResponse response = await _elasticsearchClient.Transport.RequestAsync<StringResponse>(
    Elastic.Transport.HttpMethod.POST,
    $"{indexName}/_update/{id}",
    PostData.String(postData),
    updateDocumentRequestParameters,
    cancellationToken).ConfigureAwait(false);

How are we supposed to convert such code?

Expected behavior

Provide ConnectionSettings (if relevant):

Provide DebugInformation (if relevant):

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