Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: file upload as request body #354

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Tanish2002
Copy link
Contributor

@Tanish2002 Tanish2002 commented Mar 24, 2024

PR Description

  • Enables direct file uploads using the application/octet-stream content type. The file's binary data is transmitted as the raw request body.

  • Introduces the requestFile state variable within the request model. This ensures clean separation between file uploads and other request body types (i.e, text or JSON), preventing conflicts when switching input formats.

Please tell me if I need to fix up all the codegens and their corresponding tests.

Some screenshots:

  1. successful upload:
    image
  2. Failed upload due to large payload:
    image

Related Issues

Checklist

  • I have gone through the contributing guide
  • I have updated my branch and synced it with project main branch before making this PR
  • I have run the tests (flutter test) and all tests are passing.

Added/updated tests?

  • No, and this is why: I need help with what tests I need to add, and need confirmation if the new state variable is accepted.

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.

Support File as Request Body
1 participant