// createRequestBody() func createRequestBody(photo:NSData){ var boundary:String = “——WebKitFormBoundaryasdas543wfsdfs5453533d3sdfsf3” var contentType = “multipart/form-data; boundary=\(boundary)” request.HTTPMethod = “POST” request.addValue(contentType, forHTTPHeaderField: “Content-Type”) var body = NSMutableData() body.appendData(NSString(format: “\r\n–%@\r\n”, boundary).dataUsingEncoding(NSUTF8StringEncoding)!) body.appendData(NSString(format: “Content-Disposition: form-data; name=\”photo\”; filename=\”photo.jpeg\”\r\n”).dataUsingEncoding(NSUTF8StringEncoding)!) body.appendData(NSString(format:”Content-Type: image/jpeg\r\n\r\n”).dataUsingEncoding(NSUTF8StringEncoding)!) body.appendData(photo) body.appendData(NSString(format: “\r\n–%@\r\n”, boundary).dataUsingEncoding(NSUTF8StringEncoding)!) println(body) // This will be the request body to post to your api/service } Example of request body […]
I’m working on a project where any new comment posted gets tagged with a timestamp in milliseconds (local time). My issue was when I display the comments but I want to compare the saved timestamp with the current time. I need to be able to still keep the saved timestamp and show a humanized version to […]
Categories
IOS Resources
Cocoapods CocoaPods is the dependency manager for Cocoa projects. It has thousands of libraries and can help you scale your projects elegantly. Cocoa Controls The gallbladder cialis 100mg tablets Visit Website stores liver bile, which is a KEY player in the digestive process. To check diabetes that occurs during pregnancy (gestational diabetes). soft cialis mastercard […]