Python 参数字典的传递和接收字典
使用AFNetworking,在我的iPhone应用程序中,我想在NSDictionary of parameters中传递一个参数字典,如下所示:Python 参数字典的传递和接收字典,python,objective-c,dictionary,http-post,Python,Objective C,Dictionary,Http Post,使用AFNetworking,在我的iPhone应用程序中,我想在NSDictionary of parameters中传递一个参数字典,如下所示: NSMutableDictionary *parameters = [[NSMutableDictionary alloc] init]; for (int courseIdx=0; courseIdx < courses.count; courseIdx++) { parameters[courseIdx] = [[NSMutable
NSMutableDictionary *parameters = [[NSMutableDictionary alloc] init];
for (int courseIdx=0; courseIdx < courses.count; courseIdx++)
{
parameters[courseIdx] = [[NSMutableDictionary alloc] init];
parameters[courseIdx]["courseID"] = courses[courseIdx].courseID;
parameters[courseIdx]["courseRate"] = courses[courseIdx].courseRate;
parameters[courseIdx]["profRate"] = courses[courseIdx].profRate;
}
在循环中嵌套循环有什么错?@HermannKlecker没什么错,我只需要一行代码来提取外部循环的数据(请添加代码而不是???)数据是如何从iOS传递到Python的?POST表单是URL编码的还是严格的JSON?
if request.method == 'POST':
request_data=json.loads(request.POST['request'])
????
for param_data in ???
course_id = param_data['courseID']
...