Skip to content

Add support for decoding multipart/form-data without knowing the boundary #80

@biajoeknee

Description

@biajoeknee

Is your feature request related to a problem? Please describe.
I need to parse multipart/form-data that is sent from an iOS app using Alamofire without knowing what the boundary is before decoding. I've looked around — a little bit — and it appears that this is not something supported by this library. Alamofire does not have a convenience method that permits you to specify a custom value for the boundary. By default, the boundary appears to be a randomly generated value. Alamofire does seem to support creating multipart/form-data requests with a custom boundary value, but it's a bit more involved than a single method call. It's likely the route that I'm going to take, but I thought I'd add this feature request here in case others ended up experiencing the same inconvenience.

Describe the solution you'd like
It looks to me that the boundary is defined within the body of multipart/form-data. So what I'd like is for a solution to exist that grabs this information from the data, and then uses it instead of requiring the consumer to provide it themselves.

Describe alternatives you've considered

  1. Researching how to set a custom boundary using Alamofire.
  2. Implementing a solution in Swift that suits my needs.
  3. Not uploading data in the multipart/form-data format.
  4. Using a Python script to parse the request body that is called from Swift code.

Additional context
None

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions