AFHTTPSessionManager * manager = [AFHTTPSessionManager manager];
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
manager.requestSerializer.timeoutInterval = 20;
manager.requestSerializer = [AFHTTPRequestSerializer serializer];
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/html",@"application/json",@"json/html",@"text/plain", @"text/javascript",@"text/json",nil];
//我之前是在get请求的paramaters里去添加这个用户民个密码,发现失败了,这里添加这个:
[manager.requestSerializer setAuthorizationHeaderFieldWithUsername:@"username" password:@"123456"];
网友评论