-(void)GetActivationUser{
NSString *url =
@"http://app.xxxx.com/music/search?key=%E9%AC%BC%E5%90%B9%E7%81%AF";
//创建请求管理器
AFHTTPRequestOperationManager *requestManager = [[AFHTTPRequestOperationManager
alloc] init];
requestManager.responseSerializer.acceptableContentTypes = [NSSet
setWithObjects:@"application/json",
nil];
//带上cookie
requestManager.requestSerializer.HTTPShouldHandleCookies =
YES;
[requestManager GET:url
parameters:nil
success:^(AFHTTPRequestOperation *operation,
id responseObject) {
//json 转 dict
NSDictionary *data = [NSJSONSerialization
JSONObjectWithData:responseObject
options:kNilOptions
error:nil];
}failure:^(AFHTTPRequestOperation *operation,
NSError *error) {
NSLog(@"%@",error);
}];
}
版权声明:本文为博主原创文章,未经博主允许不得转载。
时间: 2024-10-16 03:19:06