Skip to content

Conversation

@LucasPickering
Copy link
Owner

@LucasPickering LucasPickering commented Sep 19, 2025

Description

Describe the change. If there is an associated issue, please include the issue link (e.g. "Closes #xxx"). For UI changes, please also include screenshots.

This is the first part of enabling streamed responses. This includes a ton of scaffolding, so the rest of the feature will be easy to implement. If a multipart form has a field whose value is a single-chunk template, and the root of the expression is a file() call it will be streamed to the server rather than loaded into memory. For example:

body:
  type: form_multipart
  data:
    file: "{{ file('slumber.png') }}"

Closes #582

Known Risks

What issues could potentially go wrong with this change? Is it a breaking change? What have you done to mitigate any potential risks?

The tests rely on a PR I made to reqwest, which may or may not get merged. If it's not merged+released by the time this is ready to be published, I'll have to figure out another solution for the tests.

QA

How did you test this?

Lots of unit tests, tested the preview stuff in the TUI.

Checklist

  • Have you read CONTRIBUTING.md already?
  • Did you update CHANGELOG.md?
    • Not yet, since the feature is incomplete
  • Did you remove all TODOs?
    • If there are unresolved issues, please open a follow-on issue and link to it in a comment so future work can be tracked

@LucasPickering LucasPickering force-pushed the multipart-file-body-separate-context branch from 924291f to 70b889f Compare September 19, 2025 16:15
@LucasPickering LucasPickering enabled auto-merge (rebase) September 19, 2025 16:16
@LucasPickering LucasPickering force-pushed the multipart-file-body-separate-context branch 2 times, most recently from f31e57b to d5c230e Compare September 19, 2025 16:38
This streams file() calls to multipart uploads, which makes uploads more efficient and includes the file name in the upload. This also includes scaffolding to make it possible to stream command() output and also stream to non-multipart request bodies.

Closes #582
@LucasPickering LucasPickering force-pushed the multipart-file-body-separate-context branch from d5c230e to dffebdd Compare September 19, 2025 17:00
@LucasPickering LucasPickering merged commit a25caab into master Sep 19, 2025
16 checks passed
@LucasPickering LucasPickering deleted the multipart-file-body-separate-context branch September 19, 2025 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File name not submitted with multipart/form-data

2 participants