GitHub PullRequestReviewCommentEvent at 2014-07-09 23:32:53
Repository: request
Actor: mikeal
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mikeal/request/pulls/comments/14742816","id":14742816,"diff_hunk":"@@ -0,0 +1,77 @@\n+try {\n+  require('form-data')\n+} catch (e) {\n+  console.error('form-data must be installed to run this test.')\n+  console.error('skipping this test. please install form-data and run again if you need to test this feature.')\n+  process.exit(0)\n+}\n+\n+var assert = require('assert')\n+var http = require('http');\n+var path = require('path');\n+var mime = require('mime');\n+var request = require('../index');\n+var fs = require('fs');\n+\n+var remoteFile = 'http://nodejs.org/images/logo.png';\n+\n+var multipartFormData = {\n+  my_field: 'my_value',\n+  my_buffer: new Buffer([1, 2, 3]),\n+  my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),","path":"tests/test-form-mpu.js","position":21,"original_position":21,"commit_id":"50a554f42f2d2b5b5a28d63427a5c013b8c07c10","original_commit_id":"50a554f42f2d2b5b5a28d63427a5c013b8c07c10","user":{"login":"mikeal","id":579,"avatar_url":"https://avatars.githubusercontent.com/u/579?","gravatar_id":"d8eba8dd0e89a0580ec4157681121a79","url":"https://api.github.com/users/mikeal","html_url":"https://github.com/mikeal","followers_url":"https://api.github.com/users/mikeal/followers","following_url":"https://api.github.com/users/mikeal/following{/other_user}","gists_url":"https://api.github.com/users/mikeal/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeal/subscriptions","organizations_url":"https://api.github.com/users/mikeal/orgs","repos_url":"https://api.github.com/users/mikeal/repos","events_url":"https://api.github.com/users/mikeal/events{/privacy}","received_events_url":"https://api.github.com/users/mikeal/received_events","type":"User","site_admin":false},"body":"ah, thanks for finding that. it's fine if you also fix it in this patch rather than another issue :)","created_at":"2014-07-09T23:32:53Z","updated_at":"2014-07-09T23:32:53Z","html_url":"https://github.com/mikeal/request/pull/925#discussion_r14742816","pull_request_url":"https://api.github.com/repos/mikeal/request/pulls/925","_links":{"self":{"href":"https://api.github.com/repos/mikeal/request/pulls/comments/14742816"},"html":{"href":"https://github.com/mikeal/request/pull/925#discussion_r14742816"},"pull_request":{"href":"https://api.github.com/repos/mikeal/request/pulls/925"}}},"pull_request":{"url":"https://api.github.com/repos/mikeal/request/pulls/925","id":16806014,"html_url":"https://github.com/mikeal/request/pull/925","diff_url":"https://github.com/mikeal/request/pull/925.diff","patch_url":"https://github.com/mikeal/request/pull/925.patch","issue_url":"https://api.github.com/repos/mikeal/request/issues/925","number":925,"state":"open","title":"Add support for multipart form data via the request options","user":{"login":"FredKSchott","id":622227,"avatar_url":"https://avatars.githubusercontent.com/u/622227?","gravatar_id":"91b5f6b63868bb98009a85487b940c3b","url":"https://api.github.com/users/FredKSchott","html_url":"https://github.com/FredKSchott","followers_url":"https://api.github.com/users/FredKSchott/followers","following_url":"https://api.github.com/users/FredKSchott/following{/other_user}","gists_url":"https://api.github.com/users/FredKSchott/gists{/gist_id}","starred_url":"https://api.github.com/users/FredKSchott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FredKSchott/subscriptions","organizations_url":"https://api.github.com/users/FredKSchott/orgs","repos_url":"https://api.github.com/users/FredKSchott/repos","events_url":"https://api.github.com/users/FredKSchott/events{/privacy}","received_events_url":"https://api.github.com/users/FredKSchott/received_events","type":"User","site_admin":false},"body":"(See original proposal here #924)\r\n\r\n#### Summary\r\nInstead of creating your own form for multipart uploads and having to append data separately, pass the data you'd like to attach via the request options argument. For more advanced cases where the third append argument is required, the current solution can still be used.\r\n\r\n#### Before\r\n```javascript\r\n// From README#Forms\r\nvar options = { /* ... */ };\r\nvar r = request.post(options, someOptionalCallback);\r\nvar form = r.form()\r\nform.append('my_field', 'my_value')\r\nform.append('my_buffer', new Buffer([1, 2, 3]))\r\n// ...\r\n```\r\n\r\n#### After\r\n```javascript\r\nvar options = {\r\n    url: 'http://service.com/upload',\r\n    formMPU: {\r\n        my_filed: 'my_value',\r\n        my_buffer: new Buffer([1,2,3])\r\n    }\r\n};\r\nrequest(options, someOptionalCallback);\r\n```","created_at":"2014-06-06T06:22:45Z","updated_at":"2014-07-09T23:32:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6e686d0a0f16a437825b7fb4da08352d9d6d756b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mikeal/request/pulls/925/commits","review_comments_url":"https://api.github.com/repos/mikeal/request/pulls/925/comments","review_comment_url":"https://api.github.com/repos/mikeal/request/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mikeal/request/issues/925/comments","statuses_url":"https://api.github.com/repos/mikeal/request/statuses/50a554f42f2d2b5b5a28d63427a5c013b8c07c10","head":{"label":"FredKSchott:form-mpu","ref":"form-mpu","sha":"50a554f42f2d2b5b5a28d63427a5c013b8c07c10","user":{"login":"FredKSchott","id":622227,"avatar_url":"https://avatars.githubusercontent.com/u/622227?","gravatar_id":"91b5f6b63868bb98009a85487b940c3b","url":"https://api.github.com/users/FredKSchott","html_url":"https://github.com/FredKSchott","followers_url":"https://api.github.com/users/FredKSchott/followers","following_url":"https://api.github.com/users/FredKSchott/following{/other_user}","gists_url":"https://api.github.com/users/FredKSchott/gists{/gist_id}","starred_url":"https://api.github.com/users/FredKSchott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FredKSchott/subscriptions","organizations_url":"https://api.github.com/users/FredKSchott/orgs","repos_url":"https://api.github.com/users/FredKSchott/repos","events_url":"https://api.github.com/users/FredKSchott/events{/privacy}","received_events_url":"https://api.github.com/users/FredKSchott/received_events","type":"User","site_admin":false},"repo":{"id":20553432,"name":"request","full_name":"FredKSchott/request","owner":{"login":"FredKSchott","id":622227,"avatar_url":"https://avatars.githubusercontent.com/u/622227?","gravatar_id":"91b5f6b63868bb98009a85487b940c3b","url":"https://api.github.com/users/FredKSchott","html_url":"https://github.com/FredKSchott","followers_url":"https://api.github.com/users/FredKSchott/followers","following_url":"https://api.github.com/users/FredKSchott/following{/other_user}","gists_url":"https://api.github.com/users/FredKSchott/gists{/gist_id}","starred_url":"https://api.github.com/users/FredKSchott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FredKSchott/subscriptions","organizations_url":"https://api.github.com/users/FredKSchott/orgs","repos_url":"https://api.github.com/users/FredKSchott/repos","events_url":"https://api.github.com/users/FredKSchott/events{/privacy}","received_events_url":"https://api.github.com/users/FredKSchott/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/FredKSchott/request","description":"Simplified HTTP request client.","fork":true,"url":"https://api.github.com/repos/FredKSchott/request","forks_url":"https://api.github.com/repos/FredKSchott/request/forks","keys_url":"https://api.github.com/repos/FredKSchott/request/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FredKSchott/request/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FredKSchott/request/teams","hooks_url":"https://api.github.com/repos/FredKSchott/request/hooks","issue_events_url":"https://api.github.com/repos/FredKSchott/request/issues/events{/number}","events_url":"https://api.github.com/repos/FredKSchott/request/events","assignees_url":"https://api.github.com/repos/FredKSchott/request/assignees{/user}","branches_url":"https://api.github.com/repos/FredKSchott/request/branches{/branch}","tags_url":"https://api.github.com/repos/FredKSchott/request/tags","blobs_url":"https://api.github.com/repos/FredKSchott/request/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FredKSchott/request/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FredKSchott/request/git/refs{/sha}","trees_url":"https://api.github.com/repos/FredKSchott/request/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FredKSchott/request/statuses/{sha}","languages_url":"https://api.github.com/repos/FredKSchott/request/languages","stargazers_url":"https://api.github.com/repos/FredKSchott/request/stargazers","contributors_url":"https://api.github.com/repos/FredKSchott/request/contributors","subscribers_url":"https://api.github.com/repos/FredKSchott/request/subscribers","subscription_url":"https://api.github.com/repos/FredKSchott/request/subscription","commits_url":"https://api.github.com/repos/FredKSchott/request/commits{/sha}","git_commits_url":"https://api.github.com/repos/FredKSchott/request/git/commits{/sha}","comments_url":"https://api.github.com/repos/FredKSchott/request/comments{/number}","issue_comment_url":"https://api.github.com/repos/FredKSchott/request/issues/comments/{number}","contents_url":"https://api.github.com/repos/FredKSchott/request/contents/{+path}","compare_url":"https://api.github.com/repos/FredKSchott/request/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FredKSchott/request/merges","archive_url":"https://api.github.com/repos/FredKSchott/request/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FredKSchott/request/downloads","issues_url":"https://api.github.com/repos/FredKSchott/request/issues{/number}","pulls_url":"https://api.github.com/repos/FredKSchott/request/pulls{/number}","milestones_url":"https://api.github.com/repos/FredKSchott/request/milestones{/number}","notifications_url":"https://api.github.com/repos/FredKSchott/request/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FredKSchott/request/labels{/name}","releases_url":"https://api.github.com/repos/FredKSchott/request/releases{/id}","created_at":"2014-06-06T06:15:32Z","updated_at":"2014-06-06T06:22:46Z","pushed_at":"2014-07-09T23:32:53Z","git_url":"git://github.com/FredKSchott/request.git","ssh_url":"git@github.com:FredKSchott/request.git","clone_url":"https://github.com/FredKSchott/request.git","svn_url":"https://github.com/FredKSchott/request","homepage":"","size":1006,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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"}},"base":{"label":"mikeal:master","ref":"master","sha":"4fdf13b57dcd20b9fe03c0956f5df70c82d6e4a3","user":{"login":"mikeal","id":579,"avatar_url":"https://avatars.githubusercontent.com/u/579?","gravatar_id":"d8eba8dd0e89a0580ec4157681121a79","url":"https://api.github.com/users/mikeal","html_url":"https://github.com/mikeal","followers_url":"https://api.github.com/users/mikeal/followers","following_url":"https://api.github.com/users/mikeal/following{/other_user}","gists_url":"https://api.github.com/users/mikeal/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeal/subscriptions","organizations_url":"https://api.github.com/users/mikeal/orgs","repos_url":"https://api.github.com/users/mikeal/repos","events_url":"https://api.github.com/users/mikeal/events{/privacy}","received_events_url":"https://api.github.com/users/mikeal/received_events","type":"User","site_admin":false},"repo":{"id":1283503,"name":"request","full_name":"mikeal/request","owner":{"login":"mikeal","id":579,"avatar_url":"https://avatars.githubusercontent.com/u/579?","gravatar_id":"d8eba8dd0e89a0580ec4157681121a79","url":"https://api.github.com/users/mikeal","html_url":"https://github.com/mikeal","followers_url":"https://api.github.com/users/mikeal/followers","following_url":"https://api.github.com/users/mikeal/following{/other_user}","gists_url":"https://api.github.com/users/mikeal/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeal/subscriptions","organizations_url":"https://api.github.com/users/mikeal/orgs","repos_url":"https://api.github.com/users/mikeal/repos","events_url":"https://api.github.com/users/mikeal/events{/privacy}","received_events_url":"https://api.github.com/users/mikeal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mikeal/request","description":"Simplified HTTP request client.","fork":false,"url":"https://api.github.com/repos/mikeal/request","forks_url":"https://api.github.com/repos/mikeal/request/forks","keys_url":"https://api.github.com/repos/mikeal/request/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mikeal/request/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mikeal/request/teams","hooks_url":"https://api.github.com/repos/mikeal/request/hooks","issue_events_url":"https://api.github.com/repos/mikeal/request/issues/events{/number}","events_url":"https://api.github.com/repos/mikeal/request/events","assignees_url":"https://api.github.com/repos/mikeal/request/assignees{/user}","branches_url":"https://api.github.com/repos/mikeal/request/branches{/branch}","tags_url":"https://api.github.com/repos/mikeal/request/tags","blobs_url":"https://api.github.com/repos/mikeal/request/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mikeal/request/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mikeal/request/git/refs{/sha}","trees_url":"https://api.github.com/repos/mikeal/request/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mikeal/request/statuses/{sha}","languages_url":"https://api.github.com/repos/mikeal/request/languages","stargazers_url":"https://api.github.com/repos/mikeal/request/stargazers","contributors_url":"https://api.github.com/repos/mikeal/request/contributors","subscribers_url":"https://api.github.com/repos/mikeal/request/subscribers","subscription_url":"https://api.github.com/repos/mikeal/request/subscription","commits_url":"https://api.github.com/repos/mikeal/request/commits{/sha}","git_commits_url":"https://api.github.com/repos/mikeal/request/git/commits{/sha}","comments_url":"https://api.github.com/repos/mikeal/request/comments{/number}","issue_comment_url":"https://api.github.com/repos/mikeal/request/issues/comments/{number}","contents_url":"https://api.github.com/repos/mikeal/request/contents/{+path}","compare_url":"https://api.github.com/repos/mikeal/request/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mikeal/request/merges","archive_url":"https://api.github.com/repos/mikeal/request/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mikeal/request/downloads","issues_url":"https://api.github.com/repos/mikeal/request/issues{/number}","pulls_url":"https://api.github.com/repos/mikeal/request/pulls{/number}","milestones_url":"https://api.github.com/repos/mikeal/request/milestones{/number}","notifications_url":"https://api.github.com/repos/mikeal/request/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mikeal/request/labels{/name}","releases_url":"https://api.github.com/repos/mikeal/request/releases{/id}","created_at":"2011-01-23T01:25:14Z","updated_at":"2014-07-09T12:27:14Z","pushed_at":"2014-07-09T16:07:54Z","git_url":"git://github.com/mikeal/request.git","ssh_url":"git@github.com:mikeal/request.git","clone_url":"https://github.com/mikeal/request.git","svn_url":"https://github.com/mikeal/request","homepage":"","size":4744,"stargazers_count":5100,"watchers_count":5100,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":678,"mirror_url":null,"open_issues_count":306,"forks":678,"open_issues":306,"watchers":5100,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mikeal/request/pulls/925"},"html":{"href":"https://github.com/mikeal/request/pull/925"},"issue":{"href":"https://api.github.com/repos/mikeal/request/issues/925"},"comments":{"href":"https://api.github.com/repos/mikeal/request/issues/925/comments"},"review_comments":{"href":"https://api.github.com/repos/mikeal/request/pulls/925/comments"},"review_comment":{"href":"https://api.github.com/repos/mikeal/request/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mikeal/request/pulls/925/commits"},"statuses":{"href":"https://api.github.com/repos/mikeal/request/statuses/50a554f42f2d2b5b5a28d63427a5c013b8c07c10"}}}}