ios網路開發 MKNetWorkKit

來源:互聯網
上載者:User

標籤:des   style   blog   http   io   color   ar   os   使用   

常用架構比如:AFNetworking,ASIHttpRequest,SDWebImage,MKNetWorkKit等。

iOS5已出來這麼久了,而ASIHttpRequest的作者已經申明不更新了,在iOS5環境下,其實還是有些問題的。

現在MKNetWorkKi吸取了ASIHttpRequest與AFNetWorking的優點,並加入了自己特有的功能。

下載:gitHub地址:https://github.com/MugunthKumar/MKNetworkKit.git 官方使用說明:http://blog.mugunthkumar.com/products/ios-framework-introducing-mknetworkkit/ 

github下載了該項目後,如果想運行其demo,一定要開啟MKNetworkKit.xcworkspace該檔案,若單獨開啟,則編譯時間會提示缺少libMKNetworkKit-iOS.a檔案!!!

 

安裝方法

Installation

The preferred way of installation is via CocoaPods. Just add

pod ‘MKNetworkKit‘

and run pod install. It will install the most recent version of MKNetworkKit.

If you would like to use the latest code of MKNetworkKit use:

pod ‘MKNetworkKit‘, :head
安裝成功後

實現get請求

1 MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:@"www.weather.com.cn" customHeaderFields:nil];   MKNetworkOperation *op = [engine operationWithPath:@"/data/sk/101010100.html" params:nil httpMethod:@"GET" ssl:NO]; [op addCompletionHandler:^(MKNetworkOperation *operation) {2             NSLog(@"[operation responseData]-->>%@", [operation responseString]);3  }errorHandler:^(MKNetworkOperation *errorOp, NSError* err) {4         NSLog(@"MKNetwork request error : %@", [err localizedDescription]);5     }];6  [engine enqueueOperation:op];

 

 

ios網路開發 MKNetWorkKit

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.