Skip to content

Instantly share code, notes, and snippets.

@avwave
Created October 1, 2013 07:39
Show Gist options
  • Save avwave/6775044 to your computer and use it in GitHub Desktop.
Save avwave/6775044 to your computer and use it in GitHub Desktop.
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