{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/react-native/pulls/comments/243232910","pull_request_review_id":186945827,"id":243232910,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MzIzMjkxMA==","diff_hunk":"@@ -38,9 +38,20 @@ type FormDataPart =\n  *     name: 'photo.jpg',\n  *   };\n  *\n+ *   var json = {\n+ *     type: 'application/json',\n+ *     value: {\n+ *        a: 'a',\n+ *        b: 'b',\n+ *        k: 12\n+ *     },\n+ *     name:'ab'\n+ *   };","path":"Libraries/Network/FormData.js","position":40,"original_position":40,"commit_id":"21c3f83db5e77e2def8a913628bf95488ea3a45b","original_commit_id":"21c3f83db5e77e2def8a913628bf95488ea3a45b","user":{"login":"analysis-bot","id":43188587,"node_id":"MDQ6VXNlcjQzMTg4NTg3","avatar_url":"https://avatars3.githubusercontent.com/u/43188587?v=4","gravatar_id":"","url":"https://api.github.com/users/analysis-bot","html_url":"https://github.com/analysis-bot","followers_url":"https://api.github.com/users/analysis-bot/followers","following_url":"https://api.github.com/users/analysis-bot/following{/other_user}","gists_url":"https://api.github.com/users/analysis-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/analysis-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/analysis-bot/subscriptions","organizations_url":"https://api.github.com/users/analysis-bot/orgs","repos_url":"https://api.github.com/users/analysis-bot/repos","events_url":"https://api.github.com/users/analysis-bot/events{/privacy}","received_events_url":"https://api.github.com/users/analysis-bot/received_events","type":"User","site_admin":false},"body":"prettier/prettier: Delete `·`","created_at":"2018-12-20T11:03:20Z","updated_at":"2018-12-20T11:03:22Z","html_url":"https://github.com/facebook/react-native/pull/22733#discussion_r243232910","pull_request_url":"https://api.github.com/repos/facebook/react-native/pulls/22733","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments/243232910"},"html":{"href":"https://github.com/facebook/react-native/pull/22733#discussion_r243232910"},"pull_request":{"href":"https://api.github.com/repos/facebook/react-native/pulls/22733"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/22733","id":240127643,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwMTI3NjQz","html_url":"https://github.com/facebook/react-native/pull/22733","diff_url":"https://github.com/facebook/react-native/pull/22733.diff","patch_url":"https://github.com/facebook/react-native/pull/22733.patch","issue_url":"https://api.github.com/repos/facebook/react-native/issues/22733","number":22733,"state":"open","locked":false,"title":"Adding JSON support to FormData polyfill","user":{"login":"Mimetis","id":4592555,"node_id":"MDQ6VXNlcjQ1OTI1NTU=","avatar_url":"https://avatars3.githubusercontent.com/u/4592555?v=4","gravatar_id":"","url":"https://api.github.com/users/Mimetis","html_url":"https://github.com/Mimetis","followers_url":"https://api.github.com/users/Mimetis/followers","following_url":"https://api.github.com/users/Mimetis/following{/other_user}","gists_url":"https://api.github.com/users/Mimetis/gists{/gist_id}","starred_url":"https://api.github.com/users/Mimetis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mimetis/subscriptions","organizations_url":"https://api.github.com/users/Mimetis/orgs","repos_url":"https://api.github.com/users/Mimetis/repos","events_url":"https://api.github.com/users/Mimetis/events{/privacy}","received_events_url":"https://api.github.com/users/Mimetis/received_events","type":"User","site_admin":false},"body":"Hi team !\r\n\r\n\r\nIn some circumstances, we need to send a **JSON** payload as a **part** of the `FormData`.\r\nFor instance, here is what we need to send, as a final payload:\r\n\r\n```\r\n--boundary_1234-abcd \r\nContent-Type: application/json \r\nContent-Disposition: form-data; name=\"mywine\" \r\n{\r\n    'key' : 1,\r\n    'title' : 'red wine'\r\n} \r\n--boundary_1234-abcd-- \r\n```\r\n\r\nToday, the `FormData` class does not allow us to specify `Content-Type` if the payload *is not* a blob uri.\r\n\r\nThis PR fixes this issue, allowing the user to pass a JSON payload with a type property `Content-Type: application/json`.   \r\nTo do it, the `FormData` value provided by the user, must have a `value` property, containing the JSON object:\r\n``` javascript\r\n\r\n{\r\n value: {}, // JSON Payload\r\n type : 'application/json',\r\n name: 'arbitrary_name'\r\n}\r\n\r\n``` \r\nBasically, here is a straightforward sample:\r\n\r\n``` JavaScript\r\n\r\n    let payload = {\r\n      key: 1,\r\n      title : 'red wine'\r\n    };\r\n   \r\n   formData.append('json', {\r\n      value: payload,\r\n      type: 'application/json',\r\n      name :'mywine'\r\n   });\r\n``` \r\n\r\nChangelog:\r\n----------\r\n[General][added] - Add JSON support to FormData polyfill\r\n\r\nTest Plan:\r\n----------\r\nThe FormData is updated.    \r\nSee `Librairies/Network/__tests__/FormData-test.js`\r\n\r\n\r\n","created_at":"2018-12-20T10:51:42Z","updated_at":"2018-12-20T11:03:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b813f3f2de2215def612385fd43f8069d8e0d1b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1041941899,"node_id":"MDU6TGFiZWwxMDQxOTQxODk5","url":"https://api.github.com/repos/facebook/react-native/labels/%E2%9C%85PR%20Adds%20Tests","name":"✅PR Adds Tests","color":"0e8a16","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/react-native/pulls/22733/commits","review_comments_url":"https://api.github.com/repos/facebook/react-native/pulls/22733/comments","review_comment_url":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/22733/comments","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/21c3f83db5e77e2def8a913628bf95488ea3a45b","head":{"label":"Mimetis:mimetis/formdata","ref":"mimetis/formdata","sha":"21c3f83db5e77e2def8a913628bf95488ea3a45b","user":{"login":"Mimetis","id":4592555,"node_id":"MDQ6VXNlcjQ1OTI1NTU=","avatar_url":"https://avatars3.githubusercontent.com/u/4592555?v=4","gravatar_id":"","url":"https://api.github.com/users/Mimetis","html_url":"https://github.com/Mimetis","followers_url":"https://api.github.com/users/Mimetis/followers","following_url":"https://api.github.com/users/Mimetis/following{/other_user}","gists_url":"https://api.github.com/users/Mimetis/gists{/gist_id}","starred_url":"https://api.github.com/users/Mimetis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mimetis/subscriptions","organizations_url":"https://api.github.com/users/Mimetis/orgs","repos_url":"https://api.github.com/users/Mimetis/repos","events_url":"https://api.github.com/users/Mimetis/events{/privacy}","received_events_url":"https://api.github.com/users/Mimetis/received_events","type":"User","site_admin":false},"repo":{"id":162564714,"node_id":"MDEwOlJlcG9zaXRvcnkxNjI1NjQ3MTQ=","name":"react-native","full_name":"Mimetis/react-native","private":false,"owner":{"login":"Mimetis","id":4592555,"node_id":"MDQ6VXNlcjQ1OTI1NTU=","avatar_url":"https://avatars3.githubusercontent.com/u/4592555?v=4","gravatar_id":"","url":"https://api.github.com/users/Mimetis","html_url":"https://github.com/Mimetis","followers_url":"https://api.github.com/users/Mimetis/followers","following_url":"https://api.github.com/users/Mimetis/following{/other_user}","gists_url":"https://api.github.com/users/Mimetis/gists{/gist_id}","starred_url":"https://api.github.com/users/Mimetis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mimetis/subscriptions","organizations_url":"https://api.github.com/users/Mimetis/orgs","repos_url":"https://api.github.com/users/Mimetis/repos","events_url":"https://api.github.com/users/Mimetis/events{/privacy}","received_events_url":"https://api.github.com/users/Mimetis/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Mimetis/react-native","description":"A framework for building native apps with React.","fork":true,"url":"https://api.github.com/repos/Mimetis/react-native","forks_url":"https://api.github.com/repos/Mimetis/react-native/forks","keys_url":"https://api.github.com/repos/Mimetis/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mimetis/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mimetis/react-native/teams","hooks_url":"https://api.github.com/repos/Mimetis/react-native/hooks","issue_events_url":"https://api.github.com/repos/Mimetis/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/Mimetis/react-native/events","assignees_url":"https://api.github.com/repos/Mimetis/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/Mimetis/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/Mimetis/react-native/tags","blobs_url":"https://api.github.com/repos/Mimetis/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mimetis/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mimetis/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mimetis/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mimetis/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/Mimetis/react-native/languages","stargazers_url":"https://api.github.com/repos/Mimetis/react-native/stargazers","contributors_url":"https://api.github.com/repos/Mimetis/react-native/contributors","subscribers_url":"https://api.github.com/repos/Mimetis/react-native/subscribers","subscription_url":"https://api.github.com/repos/Mimetis/react-native/subscription","commits_url":"https://api.github.com/repos/Mimetis/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mimetis/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mimetis/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mimetis/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mimetis/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/Mimetis/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mimetis/react-native/merges","archive_url":"https://api.github.com/repos/Mimetis/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mimetis/react-native/downloads","issues_url":"https://api.github.com/repos/Mimetis/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/Mimetis/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/Mimetis/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/Mimetis/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mimetis/react-native/labels{/name}","releases_url":"https://api.github.com/repos/Mimetis/react-native/releases{/id}","deployments_url":"https://api.github.com/repos/Mimetis/react-native/deployments","created_at":"2018-12-20T10:35:31Z","updated_at":"2018-12-20T10:35:48Z","pushed_at":"2018-12-20T11:01:53Z","git_url":"git://github.com/Mimetis/react-native.git","ssh_url":"git@github.com:Mimetis/react-native.git","clone_url":"https://github.com/Mimetis/react-native.git","svn_url":"https://github.com/Mimetis/react-native","homepage":"https://facebook.github.io/react-native/","size":291259,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"60ff2799a1054265af9e6afeba01e373a85a768e","user":{"login":"facebook","id":69631,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5NjMx","avatar_url":"https://avatars3.githubusercontent.com/u/69631?v=4","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":29028775,"node_id":"MDEwOlJlcG9zaXRvcnkyOTAyODc3NQ==","name":"react-native","full_name":"facebook/react-native","private":false,"owner":{"login":"facebook","id":69631,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5NjMx","avatar_url":"https://avatars3.githubusercontent.com/u/69631?v=4","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/facebook/react-native","description":"A framework for building native apps with React.","fork":false,"url":"https://api.github.com/repos/facebook/react-native","forks_url":"https://api.github.com/repos/facebook/react-native/forks","keys_url":"https://api.github.com/repos/facebook/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/react-native/teams","hooks_url":"https://api.github.com/repos/facebook/react-native/hooks","issue_events_url":"https://api.github.com/repos/facebook/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/react-native/events","assignees_url":"https://api.github.com/repos/facebook/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/react-native/tags","blobs_url":"https://api.github.com/repos/facebook/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/react-native/languages","stargazers_url":"https://api.github.com/repos/facebook/react-native/stargazers","contributors_url":"https://api.github.com/repos/facebook/react-native/contributors","subscribers_url":"https://api.github.com/repos/facebook/react-native/subscribers","subscription_url":"https://api.github.com/repos/facebook/react-native/subscription","commits_url":"https://api.github.com/repos/facebook/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/react-native/merges","archive_url":"https://api.github.com/repos/facebook/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/react-native/downloads","issues_url":"https://api.github.com/repos/facebook/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/react-native/labels{/name}","releases_url":"https://api.github.com/repos/facebook/react-native/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/react-native/deployments","created_at":"2015-01-09T18:10:16Z","updated_at":"2018-12-20T11:01:16Z","pushed_at":"2018-12-20T11:01:56Z","git_url":"git://github.com/facebook/react-native.git","ssh_url":"git@github.com:facebook/react-native.git","clone_url":"https://github.com/facebook/react-native.git","svn_url":"https://github.com/facebook/react-native","homepage":"https://facebook.github.io/react-native/","size":291259,"stargazers_count":72075,"watchers_count":72075,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":16116,"mirror_url":null,"archived":false,"open_issues_count":888,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":16116,"open_issues":888,"watchers":72075,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/22733"},"html":{"href":"https://github.com/facebook/react-native/pull/22733"},"issue":{"href":"https://api.github.com/repos/facebook/react-native/issues/22733"},"comments":{"href":"https://api.github.com/repos/facebook/react-native/issues/22733/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/react-native/pulls/22733/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/react-native/pulls/22733/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/react-native/statuses/21c3f83db5e77e2def8a913628bf95488ea3a45b"}},"author_association":"NONE"}}
{"actor":{"display_login":"analysis-bot"}}