-(void) getactivationuser{
nsstring *url =@ "Http://app.xxxx.com/music/search?key=%E9%AC%BC%E5%90%B9%E7%81%AF ";
// Create request manager
afhttprequestoperationmanager *requestmanager = [[ Afhttprequestoperationmanageralloc] init];
Requestmanager. Responseserializer . Acceptablecontenttypes = [nssetsetwithobjects:@ "Application/json", Nil ];
// bring a cookie
Requestmanager. Requestserializer . httpshouldhandlecookies = YES ;
[Requestmanager GET: urlparameters:nilSuccess : ^ (afhttprequestoperation *operation,ID responseobject) {
JSON Turn Dict
nsdictionary *data = [nsjsonserializationjsonobjectwithdata : Responseobject Options : kniloptions Error:nil];
}failure: ^ (afhttprequestoperation *operation, Nserror *error) {
NSLog(@ "%@", error);
}];
}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
iOS Network Framework Afnetworking