Uploading a file using MKNetworkKit
In this recipe we will show you how to use MKNetworkKit to upload a file to a server by attaching it as part of a multipart form
POST request. Since all of MKNetworkKit's functionality is encapsulated within
MKNetworkOperation, we need to create an engine for our upload.
We will be using the
addData:forKey:mimeType:filename: method to upload an image. The
MKNetworkOperation class also has an
addFile:forKey:mimeType:filename: method that allows us to attach a file directly.
This recipe is compatible with both iOS and OS X. We need to download the framework from https://github.com/MugunthKumar/MKNetworkKit and add it to our project. We also need to add the following four frameworks: ...