AFNetWorking 3.x 传不了参数

AFNetWorking无论是get还是post都不能把参数带到后台??但是他们能够接收服务器回传回来的数据。这是为什么。

我后台是用springmvc写的

 @RequestMapping(value = "/test/index")
    public @ResponseBody BaseResult textControl(HttpServletRequest request){
        String username=request.getParameter("username");
        System.out.println("----"+username);
        BaseResult baseResult2=BaseResult.success(user);
        System.out.println(JSON.toJSONString(baseResult2));
        return baseResult2;
   }

username一直是空

IOS端

AFSecurityPolicy *securityPolicy = [[AFSecurityPolicy alloc] init];
    [securityPolicy setAllowInvalidCertificates:YES];
    
    AFHTTPSessionManager *manager=[AFHTTPSessionManager manager];
    manager.requestSerializer =[AFJSONRequestSerializer serializer];
    manager.responseSerializer = [AFJSONResponseSerializer serializer];
    
    
     if([type isEqual:@"POST"]){
        [manager POST:urlString parameters:parameter progress:nil success:requestSBlock failure:requestFBlock];
        
    }
    
     if([type isEqual:@"GET"]){
        [manager PUT:urlString parameters:parameter success:requestSBlock failure:requestFBlock];
    }

IOS端能够打出返回的结果集,但是就是不能把参数带到服务器端

查看回复