Skip to content

Stream large HTTP bodies #256

Description

@LucasPickering

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

It should be possible to stream large HTTP bodies (e.g. large file uploads), such that the entire body is never loaded into memory.

Describe the solution you'd like
A clear and concise description of what you want to happen

Templates should provide a Stream interface that allows you to stream bytes from them rather than loading and stitching everything together. For raw sections of the template we could just stream what's already in memory. For chains we could stream from whatever the byte source is (file, command, etc.).

We need a way to tell Slumber when to do this. For multipart requests it's easy, just always do it because reqwest insists on it. It should be possible to opt-in for any recipe though. The easy solution is a boolean stream field on the recipe, but we should consider alternatives.

We should also find a decent way to store the streamed body in history. Since we can't store the whole bytes, maybe just some sort of descriptor of where the data was streamed from.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered

Additional context
Add any other context or screenshots about the feature request here

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    qolImprovements that make usage smoother, without introducing new functionality

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions