Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/327.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 参数字典的传递和接收字典_Python_Objective C_Dictionary_Http Post - Fatal编程技术网

Python 参数字典的传递和接收字典

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

使用AFNetworking,在我的iPhone应用程序中,我想在NSDictionary of parameters中传递一个参数字典,如下所示:

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']
      ...