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

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

Open
biajoeknee opened this issue Dec 10, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@biajoeknee
Copy link

biajoeknee commented Dec 10, 2021

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

@biajoeknee biajoeknee added the enhancement New feature or request label Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant