I use this method to post data to my java servlet, but getParameter("2") is null, but I can still get the image.
let dics = NSMutableDictionary()
dics.setObject(1, forKey: "2")
dics.setObject(2, forKey: "3")
manager.responseSerializer.acceptableContentTypes = NSSet(object: "text/plain") as Set<NSObject>
manager.POST(urlstr, parameters: dics, constructingBodyWithBlock: {
fromData in
fromData.appendPartWithFormData(imgdata, name: "userImg")
}, success: { (operation, responseObject)in
println("bingo")
}) { (operation, error) -> Void in
println(error)
}
My question is:
How can I get the parameters?
and I want to know
appendPartWithFormData(imgdata, name: "userImg")
,how should I use the "userImg" ?
I use request.getInputStream() to get the image..