Today we go over how to make a multipart form-data request with URLSession using Swift 3. This is a step by step tutorial that will explain what is happening in each line of code so you can grasp the full concept of how to make the request and why extra steps must be taken in order to make it successful. Since this is such a complicated task, the recommended skill level will is advanced.
Multipart form-data requests are required whenever the application is required to send files like photos, videos, and audio to a server. It can also be a useful skillset if the API that you need to work with is not formatted to accept JSON requests. Knowing how to implement a multipart form-data request will give you the ability to optimize your networking code and modify it to meet your app’s needs.
The finished project will be posted up on github which you can find the link here:
If you have any questions or comments about the tutorial, or want to suggest a video to make, feel free to leave a comment below, or reach out to me on Twitter:
If you found this tutorial helpful, make sure to subscribe to the channel for more great tutorials.