Skip to content

HTTP-Post - Collection Expresssions - Data will not be sent/serialized #271

@rizi

Description

@rizi

Description
We have the following definition of an api-endpoint:

Task TransferFormatsAsync([Body] IReadOnlyCollection<ProductionManagerFormat> formats);

When we call this endpoint, like this (with collection expressions) we get 200 OK, but in the web server logs I can see that RestEase is not sending a body (it's empty):

await _api.TransferFormatsAsync([new ProductionManagerFormat("A4", 200, 300)];

To Reproduce

public interface IProductionManagerApi
{
    [Post("api/TransferFormats")]
    Task TransferFormatsAsync([Body] IReadOnlyCollection<ProductionManagerFormat> formats);
}

e.q in a controller call the api:

public void MyController (IProductionManagerApi _productionManagerApi) : ApiController 
{
   [HttpGet]
   async Task TestAsync()
   {
      await _productionManagerApi.TransferFormatsAsync([new ProductionManagerFormat("A4", 200, 300)]);
   }

}

Version Info

  • RestEase version: 1.6.4
  • Target framework version: .net 9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions