Alamofire.upload(.POST, "http://10.0.8.8/sns/my/upload_headimage.php", headers: nil, multipartFormData: { (multipartFormData) in
let ud = NSUserDefaults.standardUserDefaults()
let uid = ud.objectForKey("uid") as! String
let uidData = uid.dataUsingEncoding(NSUTF8StringEncoding)
multipartFormData.appendBodyPart(data: uidData!, name: "uid")
let path = NSBundle.mainBundle().pathForResource("11", ofType: "png")
let imageData = NSData(contentsOfFile: path!)
multipartFormData.appendBodyPart(data: imageData!, name: "headImage", fileName: "beauty.png", mimeType: "image/png")
}, encodingMemoryThreshold: 0) { (encodingResult) in
就是这么简单,
一个字母的大小写失误,
我还以为,服务器的网络故障。
参数很重要,
要研读接口文档。