Created
October 1, 2013 07:39
-
-
Save avwave/6775044 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DUETSHTTPClient *httpClient = [DUETSHTTPClient sharedHTTPClient]; | |
NSMutableURLRequest *request = [httpClient requestWithMethod:@"POST" | |
path:@"/tokens" | |
parameters:params]; | |
AFJSONRequestOperation *operation = [[AFJSONRequestOperation alloc] initWithRequest:request]; | |
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { | |
if ([self validateRequest:operation.response]) { | |
} | |
} failure:^(AFHTTPRequestOperation *operation, NSError *error) { | |
[self handleRequestError:error]; | |
}]; | |
[operation setDownloadProgressBlock:^(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) { | |
}]; | |
[httpClient enqueueHTTPRequestOperation:operation]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment