GitHub PullRequestEvent at 2014-01-26 09:38:13
Repository: AFNetworking
Actor: eleven-huang
Payload: {"action":"opened","number":1777,"pull_request":{"url":"https://api.github.com/repos/AFNetworking/AFNetworking/pulls/1777","id":11881401,"html_url":"https://github.com/AFNetworking/AFNetworking/pull/1777","diff_url":"https://github.com/AFNetworking/AFNetworking/pull/1777.diff","patch_url":"https://github.com/AFNetworking/AFNetworking/pull/1777.patch","issue_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/1777","number":1777,"state":"open","title":"Add finish block for all http request methods in AFHttpRequestOperationM...","user":{"login":"eleven-huang","id":1557852,"avatar_url":"https://gravatar.com/avatar/e11167bff2541eaff4065fe302f3fa41?d=https%3A%2F%2Fidenticons.github.com%2F0aa114f756813d6fc3457bcfb9485392.png&r=x","gravatar_id":"e11167bff2541eaff4065fe302f3fa41","url":"https://api.github.com/users/eleven-huang","html_url":"https://github.com/eleven-huang","followers_url":"https://api.github.com/users/eleven-huang/followers","following_url":"https://api.github.com/users/eleven-huang/following{/other_user}","gists_url":"https://api.github.com/users/eleven-huang/gists{/gist_id}","starred_url":"https://api.github.com/users/eleven-huang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eleven-huang/subscriptions","organizations_url":"https://api.github.com/users/eleven-huang/orgs","repos_url":"https://api.github.com/users/eleven-huang/repos","events_url":"https://api.github.com/users/eleven-huang/events{/privacy}","received_events_url":"https://api.github.com/users/eleven-huang/received_events","type":"User","site_admin":false},"body":"I need to execute some operations after a http request at many times, such as stop refreshing from UIRereshControl or hide Progress HUD.\r\n\r\n    [manager GET:url_string parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {\r\n    \t[self.refreshControl endRefreshing];\r\n    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {\r\n\t\t[self.refreshControl endRefreshing];   \r\n    }];\r\n    \r\nAs you can see, i need to writen in two places, it is annoying. \r\n\r\nSo i add a finish block to all http request methods in AFHttpRequestOperationManager, but keep the original methods.\r\n\r\n\t[manager GET:url_string parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {\r\n        \r\n    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {\r\n        \r\n    } finish:^(AFHTTPRequestOperation *operation) {\r\n       [self.refreshControl endRefreshing];\r\n    }];\r\n    \r\nThe finish block will be executed after success block or failure block.","created_at":"2014-01-26T09:38:12Z","updated_at":"2014-01-26T09:38:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AFNetworking/AFNetworking/pulls/1777/commits","review_comments_url":"https://api.github.com/repos/AFNetworking/AFNetworking/pulls/1777/comments","review_comment_url":"/repos/AFNetworking/AFNetworking/pulls/comments/{number}","comments_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/1777/comments","statuses_url":"https://api.github.com/repos/AFNetworking/AFNetworking/statuses/41c477f873dd27d1400ad37a876dd5faa79aa06c","head":{"label":"eleven-huang:master","ref":"master","sha":"41c477f873dd27d1400ad37a876dd5faa79aa06c","user":{"login":"eleven-huang","id":1557852,"avatar_url":"https://gravatar.com/avatar/e11167bff2541eaff4065fe302f3fa41?d=https%3A%2F%2Fidenticons.github.com%2F0aa114f756813d6fc3457bcfb9485392.png&r=x","gravatar_id":"e11167bff2541eaff4065fe302f3fa41","url":"https://api.github.com/users/eleven-huang","html_url":"https://github.com/eleven-huang","followers_url":"https://api.github.com/users/eleven-huang/followers","following_url":"https://api.github.com/users/eleven-huang/following{/other_user}","gists_url":"https://api.github.com/users/eleven-huang/gists{/gist_id}","starred_url":"https://api.github.com/users/eleven-huang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eleven-huang/subscriptions","organizations_url":"https://api.github.com/users/eleven-huang/orgs","repos_url":"https://api.github.com/users/eleven-huang/repos","events_url":"https://api.github.com/users/eleven-huang/events{/privacy}","received_events_url":"https://api.github.com/users/eleven-huang/received_events","type":"User","site_admin":false},"repo":{"id":16250091,"name":"AFNetworking","full_name":"eleven-huang/AFNetworking","owner":{"login":"eleven-huang","id":1557852,"avatar_url":"https://gravatar.com/avatar/e11167bff2541eaff4065fe302f3fa41?d=https%3A%2F%2Fidenticons.github.com%2F0aa114f756813d6fc3457bcfb9485392.png&r=x","gravatar_id":"e11167bff2541eaff4065fe302f3fa41","url":"https://api.github.com/users/eleven-huang","html_url":"https://github.com/eleven-huang","followers_url":"https://api.github.com/users/eleven-huang/followers","following_url":"https://api.github.com/users/eleven-huang/following{/other_user}","gists_url":"https://api.github.com/users/eleven-huang/gists{/gist_id}","starred_url":"https://api.github.com/users/eleven-huang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eleven-huang/subscriptions","organizations_url":"https://api.github.com/users/eleven-huang/orgs","repos_url":"https://api.github.com/users/eleven-huang/repos","events_url":"https://api.github.com/users/eleven-huang/events{/privacy}","received_events_url":"https://api.github.com/users/eleven-huang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eleven-huang/AFNetworking","description":"A delightful iOS and OS X networking framework","fork":true,"url":"https://api.github.com/repos/eleven-huang/AFNetworking","forks_url":"https://api.github.com/repos/eleven-huang/AFNetworking/forks","keys_url":"https://api.github.com/repos/eleven-huang/AFNetworking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eleven-huang/AFNetworking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eleven-huang/AFNetworking/teams","hooks_url":"https://api.github.com/repos/eleven-huang/AFNetworking/hooks","issue_events_url":"https://api.github.com/repos/eleven-huang/AFNetworking/issues/events{/number}","events_url":"https://api.github.com/repos/eleven-huang/AFNetworking/events","assignees_url":"https://api.github.com/repos/eleven-huang/AFNetworking/assignees{/user}","branches_url":"https://api.github.com/repos/eleven-huang/AFNetworking/branches{/branch}","tags_url":"https://api.github.com/repos/eleven-huang/AFNetworking/tags","blobs_url":"https://api.github.com/repos/eleven-huang/AFNetworking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eleven-huang/AFNetworking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eleven-huang/AFNetworking/git/refs{/sha}","trees_url":"https://api.github.com/repos/eleven-huang/AFNetworking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eleven-huang/AFNetworking/statuses/{sha}","languages_url":"https://api.github.com/repos/eleven-huang/AFNetworking/languages","stargazers_url":"https://api.github.com/repos/eleven-huang/AFNetworking/stargazers","contributors_url":"https://api.github.com/repos/eleven-huang/AFNetworking/contributors","subscribers_url":"https://api.github.com/repos/eleven-huang/AFNetworking/subscribers","subscription_url":"https://api.github.com/repos/eleven-huang/AFNetworking/subscription","commits_url":"https://api.github.com/repos/eleven-huang/AFNetworking/commits{/sha}","git_commits_url":"https://api.github.com/repos/eleven-huang/AFNetworking/git/commits{/sha}","comments_url":"https://api.github.com/repos/eleven-huang/AFNetworking/comments{/number}","issue_comment_url":"https://api.github.com/repos/eleven-huang/AFNetworking/issues/comments/{number}","contents_url":"https://api.github.com/repos/eleven-huang/AFNetworking/contents/{+path}","compare_url":"https://api.github.com/repos/eleven-huang/AFNetworking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eleven-huang/AFNetworking/merges","archive_url":"https://api.github.com/repos/eleven-huang/AFNetworking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eleven-huang/AFNetworking/downloads","issues_url":"https://api.github.com/repos/eleven-huang/AFNetworking/issues{/number}","pulls_url":"https://api.github.com/repos/eleven-huang/AFNetworking/pulls{/number}","milestones_url":"https://api.github.com/repos/eleven-huang/AFNetworking/milestones{/number}","notifications_url":"https://api.github.com/repos/eleven-huang/AFNetworking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eleven-huang/AFNetworking/labels{/name}","releases_url":"https://api.github.com/repos/eleven-huang/AFNetworking/releases{/id}","created_at":"2014-01-26T08:59:53Z","updated_at":"2014-01-26T09:38:12Z","pushed_at":"2014-01-26T09:13:58Z","git_url":"git://github.com/eleven-huang/AFNetworking.git","ssh_url":"git@github.com:eleven-huang/AFNetworking.git","clone_url":"https://github.com/eleven-huang/AFNetworking.git","svn_url":"https://github.com/eleven-huang/AFNetworking","homepage":"http://afnetworking.com","size":13332,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","master_branch":"master"}},"base":{"label":"AFNetworking:master","ref":"master","sha":"58da49168a8aeb24fdd7b887a3084cc2dd6f849e","user":{"login":"AFNetworking","id":1181541,"avatar_url":"https://gravatar.com/avatar/2dd769dee380246925ca8bed7cf5d26f?d=https%3A%2F%2Fidenticons.github.com%2Fc1860200e6a0038438224a23f8573b82.png&r=x","gravatar_id":"2dd769dee380246925ca8bed7cf5d26f","url":"https://api.github.com/users/AFNetworking","html_url":"https://github.com/AFNetworking","followers_url":"https://api.github.com/users/AFNetworking/followers","following_url":"https://api.github.com/users/AFNetworking/following{/other_user}","gists_url":"https://api.github.com/users/AFNetworking/gists{/gist_id}","starred_url":"https://api.github.com/users/AFNetworking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AFNetworking/subscriptions","organizations_url":"https://api.github.com/users/AFNetworking/orgs","repos_url":"https://api.github.com/users/AFNetworking/repos","events_url":"https://api.github.com/users/AFNetworking/events{/privacy}","received_events_url":"https://api.github.com/users/AFNetworking/received_events","type":"Organization","site_admin":false},"repo":{"id":1828795,"name":"AFNetworking","full_name":"AFNetworking/AFNetworking","owner":{"login":"AFNetworking","id":1181541,"avatar_url":"https://gravatar.com/avatar/2dd769dee380246925ca8bed7cf5d26f?d=https%3A%2F%2Fidenticons.github.com%2Fc1860200e6a0038438224a23f8573b82.png&r=x","gravatar_id":"2dd769dee380246925ca8bed7cf5d26f","url":"https://api.github.com/users/AFNetworking","html_url":"https://github.com/AFNetworking","followers_url":"https://api.github.com/users/AFNetworking/followers","following_url":"https://api.github.com/users/AFNetworking/following{/other_user}","gists_url":"https://api.github.com/users/AFNetworking/gists{/gist_id}","starred_url":"https://api.github.com/users/AFNetworking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AFNetworking/subscriptions","organizations_url":"https://api.github.com/users/AFNetworking/orgs","repos_url":"https://api.github.com/users/AFNetworking/repos","events_url":"https://api.github.com/users/AFNetworking/events{/privacy}","received_events_url":"https://api.github.com/users/AFNetworking/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AFNetworking/AFNetworking","description":"A delightful iOS and OS X networking framework","fork":false,"url":"https://api.github.com/repos/AFNetworking/AFNetworking","forks_url":"https://api.github.com/repos/AFNetworking/AFNetworking/forks","keys_url":"https://api.github.com/repos/AFNetworking/AFNetworking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AFNetworking/AFNetworking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AFNetworking/AFNetworking/teams","hooks_url":"https://api.github.com/repos/AFNetworking/AFNetworking/hooks","issue_events_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/events{/number}","events_url":"https://api.github.com/repos/AFNetworking/AFNetworking/events","assignees_url":"https://api.github.com/repos/AFNetworking/AFNetworking/assignees{/user}","branches_url":"https://api.github.com/repos/AFNetworking/AFNetworking/branches{/branch}","tags_url":"https://api.github.com/repos/AFNetworking/AFNetworking/tags","blobs_url":"https://api.github.com/repos/AFNetworking/AFNetworking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AFNetworking/AFNetworking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AFNetworking/AFNetworking/git/refs{/sha}","trees_url":"https://api.github.com/repos/AFNetworking/AFNetworking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AFNetworking/AFNetworking/statuses/{sha}","languages_url":"https://api.github.com/repos/AFNetworking/AFNetworking/languages","stargazers_url":"https://api.github.com/repos/AFNetworking/AFNetworking/stargazers","contributors_url":"https://api.github.com/repos/AFNetworking/AFNetworking/contributors","subscribers_url":"https://api.github.com/repos/AFNetworking/AFNetworking/subscribers","subscription_url":"https://api.github.com/repos/AFNetworking/AFNetworking/subscription","commits_url":"https://api.github.com/repos/AFNetworking/AFNetworking/commits{/sha}","git_commits_url":"https://api.github.com/repos/AFNetworking/AFNetworking/git/commits{/sha}","comments_url":"https://api.github.com/repos/AFNetworking/AFNetworking/comments{/number}","issue_comment_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/comments/{number}","contents_url":"https://api.github.com/repos/AFNetworking/AFNetworking/contents/{+path}","compare_url":"https://api.github.com/repos/AFNetworking/AFNetworking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AFNetworking/AFNetworking/merges","archive_url":"https://api.github.com/repos/AFNetworking/AFNetworking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AFNetworking/AFNetworking/downloads","issues_url":"https://api.github.com/repos/AFNetworking/AFNetworking/issues{/number}","pulls_url":"https://api.github.com/repos/AFNetworking/AFNetworking/pulls{/number}","milestones_url":"https://api.github.com/repos/AFNetworking/AFNetworking/milestones{/number}","notifications_url":"https://api.github.com/repos/AFNetworking/AFNetworking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AFNetworking/AFNetworking/labels{/name}","releases_url":"https://api.github.com/repos/AFNetworking/AFNetworking/releases{/id}","created_at":"2011-05-31T21:28:44Z","updated_at":"2014-01-24T22:09:53Z","pushed_at":"2014-01-21T18:53:54Z","git_url":"git://github.com/AFNetworking/AFNetworking.git","ssh_url":"git@github.com:AFNetworking/AFNetworking.git","clone_url":"https://github.com/AFNetworking/AFNetworking.git","svn_url":"https://github.com/AFNetworking/AFNetworking","homepage":"http://afnetworking.com","size":13332,"stargazers_count":10471,"watchers_count":10471,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":2830,"mirror_url":null,"open_issues_count":35,"forks":2830,"open_issues":35,"watchers":10471,"default_branch":"master","master_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AFNetworking/AFNetworking/pulls/1777"},"html":{"href":"https://github.com/AFNetworking/AFNetworking/pull/1777"},"issue":{"href":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/1777"},"comments":{"href":"https://api.github.com/repos/AFNetworking/AFNetworking/issues/1777/comments"},"review_comments":{"href":"https://api.github.com/repos/AFNetworking/AFNetworking/pulls/1777/comments"},"commits":{"href":"https://api.github.com/repos/AFNetworking/AFNetworking/pulls/1777/commits"},"statuses":{"href":"https://api.github.com/repos/AFNetworking/AFNetworking/statuses/41c477f873dd27d1400ad37a876dd5faa79aa06c"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":174,"deletions":34,"changed_files":4}}