Skip to content

New method for downloading streams #2226

@alexeyzimarev

Description

@alexeyzimarev

My current thought is to change the interface signature and make Download work differently. Right now, it returns Task<Stream?>, which prevents the user to inspect the response for errors. It crashes if the call wasn't successful.

So, the idea is to make ExecuteStreamAsync, which will return Task<RestStreamResponse>. The response will be like RestResponse but instead of Content it will have Stream?. Naturally, it requires to be IDisposable.

The first step there was to create a source generator to create instance of RestResponseBase child class, as copying those properties manually is error prone (adding a new prop requires many changes). That part is done, so now this thing should be relatively easy.

Originally posted by @alexeyzimarev in #2072 (comment)

Metadata

Metadata

Assignees

No one assigned

    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