我已经设置了AFNetworking,但它不接受https网址.如何让AFNEtworking通过ssl进行连接.
我有以下代码:
NSMutableURLRequest *apiRequest = [self multipartFormRequestWithMethod:@"POST" path: pathstr parameters: params constructingBodyWithBlock: ^(id <AFMultipartFormData>formData) { //TODO: attach file if needed }]; AFJSONRequestOperation* operation = [[AFJSONRequestOperation alloc] initWithRequest: apiRequest]; [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation,id responSEObject) { //success! completionBlock(responSEObject); } failure:^(AFHTTPRequestOperation *operation,NSError *error) { //failure :( NSLog(@"%@",error); completionBlock([NSDictionary dictionaryWithObject:[error localizedDescription] forKey:@"error"]); }]; [operation start];