我想構建我的NSMutableDictionary發送到使用AFNetworking框架的請求,但似乎我很困惑如何正確地做到這一點。AFNetworking - NSMutableDictionary參數
這裏是服務器的期待
{
"do":"timeline",
"what":"posting",
"session":"",
"data":{
"status_timeline":"",
"with_timeline":"",
"location_timeline":"",
"category_timeline":"",
"privacy_timeline":""
}
,我已經試過這樣
NSMutableDictionary *dict = [[NSMutableDictionary alloc]init];
[dict setValue:@"timeline" forKey:@"do"];
[dict setValue:@"posting" forKey:@"what"];
[dict setValue:session forKey:@"session"];
NSLog(@"Session %@", [dict valueForKey:@"session"]);
我希望有人能幫助我感謝的
歡迎來到SO。這是你的第二個問題,「我該怎麼做xyz」。這不是教程網站,您需要指定您的問題,到目前爲止所嘗試的內容,獲得的結果,遇到的錯誤以及期望的內容,以及針對您需要的特定問題的特定問題解決。請在通過http://stackoverflow.com/help/how-to-ask閱讀更多問題以避免出現標誌。有多個線程與您試圖實現,例如:http://stackoverflow.com/questions/34434728/how-to-post-json-parameters-using-afnetworking – 2017-02-17 03:43:47