Skip to content
プロジェクト

shaioz/AFNetworking-AutoRetry

GitHubで見る

概要

An iOS category adding retry functionality to requests made using AFNetworking 2

Web・アプリ開発

この数値の測り方

計測したスター増加

24時間
0
7日間
0
15日間
0
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

AFNetworking-AutoRetry

An iOS category adding retry functionality to requests made using AFNetworking 2

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like AFNetworking in your projects. See the "Getting Started" guide for more information. You can install it with the following command:

$ gem install cocoapods

To integrate AFNetworking-AutoRetry into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'AFNetworking+AutoRetry'

Then, run the following command:

pod install

Usage

Import the libraries at the top of your .m file

#import <AFNetworking/AFHTTPRequestOperationManager.h>
#import <AFNetworking+AutoRetry/AFHTTPRequestOperationManager+AutoRetry.h>

Then, in your function:

// setup POST data
NSDictionary *parameters = @{@"key":@"value"};
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
// set the network timeout duration to 30 seconds
manager.requestSerializer = [[AFHTTPRequestSerializerWithTimeout alloc] initWithTimeout:30];
[manager POST:@"http://www.example.com/api" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
    // success, parse the response here
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    // failure, e.g. network error
} autoRetry:3];

where 3 is the number of retries. Similar for GET cases.

##Communication If you encounter any questions or issues, please use the tag afnetworking-autoretry to ask in Stack Overflow. If you think you found a bug, please report it at Issues.

##Credits AFNetworking is owned and maintained by the Alamofire Software Foundation. AFNetworking-AutoRetry is created by Shai Ohev Zion and now maintained by Shivan Raptor and Daniel Jankovič.

関連プロジェクトを探す

読み込み中…