Developed under iOS has been using the asihttprequest Library,ASIHTTPRequest has stopped updating and read this article http://www.oschina.net/news/ 61416/github-top-100-objective-c-projects (Original https://github.com/Aufree/trip-to-iOS/blob/master/ TOP-100.MD) Afnetworking Library, feel good.
the address of the Afnetworking library is
Https://github.com/AFNetworking/AFNetworking
As you can see on the homepage, the use of the Afnetworking library is simple
GET request
Afhttprequestoperationmanager *manager = [Afhttprequestoperationmanager manager]; [Manager get:@ "Http://example.com/resources.json" Parameters:nil success:^ (afhttprequestoperation *operation, ID Responseobject) {NSLog (@ "JSON:%@", Responseobject);} failure:^ (Afhttprequestoperation *operation, Nserror *error) { NSLog (@ "error:%@", error);}];
POST request
Afhttprequestoperationmanager *manager = [Afhttprequestoperationmanager manager]; Nsdictionary *parameters = @{@ "foo": @ "bar"}; [Manager post:@ "Http://example.com/resources.json" Parameters:parameters success:^ (Afhttprequestoperation * operation, id responseobject) {NSLog (@ "JSON:%@", Responseobject);} failure:^ (Afhttprequestoperation *operation, NSERR or *error) {NSLog (@ "error:%@", error);}];
There are plenty of ways to go directly to the GitHub homepage to see https://github.com/AFNetworking/AFNetworking
HTTP Library afnetworking under iOS