1
我想從我的iPhone應用程序中使用POST方法將用戶圖片和用戶的其他信息發送到服務器。forHTTPHeaderField:@「content-type」用於圖像和數據
我的內容類型如下
NSString *boundary = [NSString stringWithString:@"--"];
NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary];
[request addValue:contentType forHTTPHeaderField: @"Content-Type"];
但只張貼圖片。我的其他數據不在服務器上發佈。
如果我使用下面的內容類型,然後
[ request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"];
則只能發送其他數據。不發送圖像。
請向我建議我可以發送圖像和其他信息的方式。
爲什麼?這不再是積極的發展http://allseeing-i.com/[request_release]。當有人向某人詢問實現細節時,只需鏈接到某個框架並不是一個好的答案。 – Abizern 2012-02-04 10:38:47
它不再積極的發展,但它仍然工作順利,我給他一個替代方案,因爲即使在45分鐘後沒有人回答他的問題 – 2012-02-04 10:57:24
但引用他的框架仍然不是他的問題的答案。 – Abizern 2012-02-04 11:25:03