Skip to content

Streaming files to API (uploading) without multipart/form-data #1422

Closed

Description

@maeni70

Expected Behavior

Allow sending files in chunks (via stream) without multipart/form-data.

The same question has already been asked at stackoverflow:
https://stackoverflow.com/questions/35478663/upload-file-without-multipart-form-data-using-restsharp

However, it has not been correctly answered.

Is there any way how to stream large files to an API but without multipart/form-data? I retrieve an "UnsupportedMediaType" response when trying to do so. It seems that RestSharp is automatically sending the request as multipart/form-data if files are attached in body.

There are examples how to do with .NET HttpWebRequest (see linked stackoverflow question above) or Java, but I could not achieve with RestSharp library.

Thanks,
Roger

Activity

  1. maeni70 commented on Feb 3, 2020

    @maeni70
    Author

    For the specific upload functionality I have written own logic using standard HttpClient, which is a pity as I have to maintain an additional client object (with corresponding redundancies).

  2. stale commented on May 3, 2020

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  3. repo-ranger commented on May 3, 2020

    @repo-ranger

    ⚠️ This issue has been marked wontfix and will be closed in 3 days

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions