{"action":"created","comment":{"url":"https://api.github.com/repos/playframework/playframework/pulls/comments/55924543","id":55924543,"diff_hunk":"@@ -0,0 +1,46 @@\n+/*\n+ * Copyright (C) 2009-2016 Lightbend Inc. <https://www.lightbend.com>\n+ */\n+package play.mvc;\n+\n+import akka.stream.javadsl.Source;\n+import akka.util.ByteString;\n+import play.api.mvc.MultipartFormData;\n+import play.core.formatters.Multipart;\n+import scala.Option;\n+\n+import java.util.concurrent.ThreadLocalRandom;\n+\n+\n+public class MultipartFormatter {\n+\n+    public static String randomBoundary() {\n+        return Multipart.randomBoundary(18, ThreadLocalRandom.current());\n+    }\n+\n+    public static String boundaryToContentType(String boundary) {\n+        return new StringBuilder().append(\"multipart/form-data; boundary=\").append(boundary).toString();\n+    }\n+\n+    public static Source<ByteString, ?> transform(Source<? super Http.MultipartFormData.Part<Source<ByteString, ?>>, ?> parts, String boundary) {","path":"framework/src/play/src/main/java/play/mvc/MultipartFormatter.java","position":null,"original_position":25,"commit_id":"94b70fb1397cf37b21e78de9ad2d68b40c6227cf","original_commit_id":"15f2aac35c20e1fb86778668266c0800b1768a7e","user":{"login":"gmethvin","id":171663,"avatar_url":"https://avatars.githubusercontent.com/u/171663?v=3","gravatar_id":"","url":"https://api.github.com/users/gmethvin","html_url":"https://github.com/gmethvin","followers_url":"https://api.github.com/users/gmethvin/followers","following_url":"https://api.github.com/users/gmethvin/following{/other_user}","gists_url":"https://api.github.com/users/gmethvin/gists{/gist_id}","starred_url":"https://api.github.com/users/gmethvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmethvin/subscriptions","organizations_url":"https://api.github.com/users/gmethvin/orgs","repos_url":"https://api.github.com/users/gmethvin/repos","events_url":"https://api.github.com/users/gmethvin/events{/privacy}","received_events_url":"https://api.github.com/users/gmethvin/received_events","type":"User","site_admin":false},"body":"Actually I was wrong about the cast. Anyway not a big deal since this is sort of internal code.","created_at":"2016-03-12T17:26:54Z","updated_at":"2016-03-12T17:26:54Z","html_url":"https://github.com/playframework/playframework/pull/5698#discussion_r55924543","pull_request_url":"https://api.github.com/repos/playframework/playframework/pulls/5698","_links":{"self":{"href":"https://api.github.com/repos/playframework/playframework/pulls/comments/55924543"},"html":{"href":"https://github.com/playframework/playframework/pull/5698#discussion_r55924543"},"pull_request":{"href":"https://api.github.com/repos/playframework/playframework/pulls/5698"}}},"pull_request":{"url":"https://api.github.com/repos/playframework/playframework/pulls/5698","id":59924744,"html_url":"https://github.com/playframework/playframework/pull/5698","diff_url":"https://github.com/playframework/playframework/pull/5698.diff","patch_url":"https://github.com/playframework/playframework/pull/5698.patch","issue_url":"https://api.github.com/repos/playframework/playframework/issues/5698","number":5698,"state":"open","locked":false,"title":"(WIP) Fixes #902 added a way to sent multipart/form-data requests via play-ws","user":{"login":"schmitch","id":1641401,"avatar_url":"https://avatars.githubusercontent.com/u/1641401?v=3","gravatar_id":"","url":"https://api.github.com/users/schmitch","html_url":"https://github.com/schmitch","followers_url":"https://api.github.com/users/schmitch/followers","following_url":"https://api.github.com/users/schmitch/following{/other_user}","gists_url":"https://api.github.com/users/schmitch/gists{/gist_id}","starred_url":"https://api.github.com/users/schmitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmitch/subscriptions","organizations_url":"https://api.github.com/users/schmitch/orgs","repos_url":"https://api.github.com/users/schmitch/repos","events_url":"https://api.github.com/users/schmitch/events{/privacy}","received_events_url":"https://api.github.com/users/schmitch/received_events","type":"User","site_admin":false},"body":"Hello here is a PR for #902, actually it misses the following things:\r\n\r\n- [ ] more Documentation?! (especially for FileIO)\r\n- [ ] more Tests?!\r\n- [x] squash commits\r\n- [x] Java Code\r\n\r\nActually before providing a Documentation I wanted to grab some feedback if that is clever enough.\r\nAlso I'm not sure where to put tests for that behavior since there aren't many tests for WS yet.\r\n\r\n**Edit:** \r\nActually what I thought is if I should provide custom interfaces for Part, however then I thought that actually implementing them on top would actually double the work here, however It could be good to add them later, so that we could send JsValue and XML without additional work. However for the moment I found that satisfying, since there aren't many frameworks that actually parse anything else than StringParts and FileParts, actually even Play only knows how to handle Content-Disposition=form-data. \r\n\r\n**Edit2:** I added documentation, I'm still unsure about additional tests, are they required? And when, where could I put them? Would've put them into ``play.libs.ws.WSSpec`` and ``play.api.libs.ws.WSRequestSpec``","created_at":"2016-02-19T09:37:09Z","updated_at":"2016-03-12T17:26:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b964e5a9abac1dc1bca791677bbacf7d86e936f2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/playframework/playframework/pulls/5698/commits","review_comments_url":"https://api.github.com/repos/playframework/playframework/pulls/5698/comments","review_comment_url":"https://api.github.com/repos/playframework/playframework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/playframework/playframework/issues/5698/comments","statuses_url":"https://api.github.com/repos/playframework/playframework/statuses/94b70fb1397cf37b21e78de9ad2d68b40c6227cf","head":{"label":"schmitch:added-multipart-form-data","ref":"added-multipart-form-data","sha":"94b70fb1397cf37b21e78de9ad2d68b40c6227cf","user":{"login":"schmitch","id":1641401,"avatar_url":"https://avatars.githubusercontent.com/u/1641401?v=3","gravatar_id":"","url":"https://api.github.com/users/schmitch","html_url":"https://github.com/schmitch","followers_url":"https://api.github.com/users/schmitch/followers","following_url":"https://api.github.com/users/schmitch/following{/other_user}","gists_url":"https://api.github.com/users/schmitch/gists{/gist_id}","starred_url":"https://api.github.com/users/schmitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmitch/subscriptions","organizations_url":"https://api.github.com/users/schmitch/orgs","repos_url":"https://api.github.com/users/schmitch/repos","events_url":"https://api.github.com/users/schmitch/events{/privacy}","received_events_url":"https://api.github.com/users/schmitch/received_events","type":"User","site_admin":false},"repo":{"id":46038091,"name":"playframework","full_name":"schmitch/playframework","owner":{"login":"schmitch","id":1641401,"avatar_url":"https://avatars.githubusercontent.com/u/1641401?v=3","gravatar_id":"","url":"https://api.github.com/users/schmitch","html_url":"https://github.com/schmitch","followers_url":"https://api.github.com/users/schmitch/followers","following_url":"https://api.github.com/users/schmitch/following{/other_user}","gists_url":"https://api.github.com/users/schmitch/gists{/gist_id}","starred_url":"https://api.github.com/users/schmitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmitch/subscriptions","organizations_url":"https://api.github.com/users/schmitch/orgs","repos_url":"https://api.github.com/users/schmitch/repos","events_url":"https://api.github.com/users/schmitch/events{/privacy}","received_events_url":"https://api.github.com/users/schmitch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/schmitch/playframework","description":"Play Framework","fork":true,"url":"https://api.github.com/repos/schmitch/playframework","forks_url":"https://api.github.com/repos/schmitch/playframework/forks","keys_url":"https://api.github.com/repos/schmitch/playframework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/schmitch/playframework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/schmitch/playframework/teams","hooks_url":"https://api.github.com/repos/schmitch/playframework/hooks","issue_events_url":"https://api.github.com/repos/schmitch/playframework/issues/events{/number}","events_url":"https://api.github.com/repos/schmitch/playframework/events","assignees_url":"https://api.github.com/repos/schmitch/playframework/assignees{/user}","branches_url":"https://api.github.com/repos/schmitch/playframework/branches{/branch}","tags_url":"https://api.github.com/repos/schmitch/playframework/tags","blobs_url":"https://api.github.com/repos/schmitch/playframework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/schmitch/playframework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/schmitch/playframework/git/refs{/sha}","trees_url":"https://api.github.com/repos/schmitch/playframework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/schmitch/playframework/statuses/{sha}","languages_url":"https://api.github.com/repos/schmitch/playframework/languages","stargazers_url":"https://api.github.com/repos/schmitch/playframework/stargazers","contributors_url":"https://api.github.com/repos/schmitch/playframework/contributors","subscribers_url":"https://api.github.com/repos/schmitch/playframework/subscribers","subscription_url":"https://api.github.com/repos/schmitch/playframework/subscription","commits_url":"https://api.github.com/repos/schmitch/playframework/commits{/sha}","git_commits_url":"https://api.github.com/repos/schmitch/playframework/git/commits{/sha}","comments_url":"https://api.github.com/repos/schmitch/playframework/comments{/number}","issue_comment_url":"https://api.github.com/repos/schmitch/playframework/issues/comments{/number}","contents_url":"https://api.github.com/repos/schmitch/playframework/contents/{+path}","compare_url":"https://api.github.com/repos/schmitch/playframework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/schmitch/playframework/merges","archive_url":"https://api.github.com/repos/schmitch/playframework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/schmitch/playframework/downloads","issues_url":"https://api.github.com/repos/schmitch/playframework/issues{/number}","pulls_url":"https://api.github.com/repos/schmitch/playframework/pulls{/number}","milestones_url":"https://api.github.com/repos/schmitch/playframework/milestones{/number}","notifications_url":"https://api.github.com/repos/schmitch/playframework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/schmitch/playframework/labels{/name}","releases_url":"https://api.github.com/repos/schmitch/playframework/releases{/id}","deployments_url":"https://api.github.com/repos/schmitch/playframework/deployments","created_at":"2015-11-12T07:57:24Z","updated_at":"2016-02-26T10:15:18Z","pushed_at":"2016-03-12T17:20:07Z","git_url":"git://github.com/schmitch/playframework.git","ssh_url":"git@github.com:schmitch/playframework.git","clone_url":"https://github.com/schmitch/playframework.git","svn_url":"https://github.com/schmitch/playframework","homepage":"http://www.playframework.com/","size":81475,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"playframework:master","ref":"master","sha":"88123f4edf59a2328fc48f78d2ef4fcff97d39be","user":{"login":"playframework","id":319107,"avatar_url":"https://avatars.githubusercontent.com/u/319107?v=3","gravatar_id":"","url":"https://api.github.com/users/playframework","html_url":"https://github.com/playframework","followers_url":"https://api.github.com/users/playframework/followers","following_url":"https://api.github.com/users/playframework/following{/other_user}","gists_url":"https://api.github.com/users/playframework/gists{/gist_id}","starred_url":"https://api.github.com/users/playframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/playframework/subscriptions","organizations_url":"https://api.github.com/users/playframework/orgs","repos_url":"https://api.github.com/users/playframework/repos","events_url":"https://api.github.com/users/playframework/events{/privacy}","received_events_url":"https://api.github.com/users/playframework/received_events","type":"Organization","site_admin":false},"repo":{"id":2340549,"name":"playframework","full_name":"playframework/playframework","owner":{"login":"playframework","id":319107,"avatar_url":"https://avatars.githubusercontent.com/u/319107?v=3","gravatar_id":"","url":"https://api.github.com/users/playframework","html_url":"https://github.com/playframework","followers_url":"https://api.github.com/users/playframework/followers","following_url":"https://api.github.com/users/playframework/following{/other_user}","gists_url":"https://api.github.com/users/playframework/gists{/gist_id}","starred_url":"https://api.github.com/users/playframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/playframework/subscriptions","organizations_url":"https://api.github.com/users/playframework/orgs","repos_url":"https://api.github.com/users/playframework/repos","events_url":"https://api.github.com/users/playframework/events{/privacy}","received_events_url":"https://api.github.com/users/playframework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/playframework/playframework","description":"Play Framework","fork":false,"url":"https://api.github.com/repos/playframework/playframework","forks_url":"https://api.github.com/repos/playframework/playframework/forks","keys_url":"https://api.github.com/repos/playframework/playframework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/playframework/playframework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/playframework/playframework/teams","hooks_url":"https://api.github.com/repos/playframework/playframework/hooks","issue_events_url":"https://api.github.com/repos/playframework/playframework/issues/events{/number}","events_url":"https://api.github.com/repos/playframework/playframework/events","assignees_url":"https://api.github.com/repos/playframework/playframework/assignees{/user}","branches_url":"https://api.github.com/repos/playframework/playframework/branches{/branch}","tags_url":"https://api.github.com/repos/playframework/playframework/tags","blobs_url":"https://api.github.com/repos/playframework/playframework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/playframework/playframework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/playframework/playframework/git/refs{/sha}","trees_url":"https://api.github.com/repos/playframework/playframework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/playframework/playframework/statuses/{sha}","languages_url":"https://api.github.com/repos/playframework/playframework/languages","stargazers_url":"https://api.github.com/repos/playframework/playframework/stargazers","contributors_url":"https://api.github.com/repos/playframework/playframework/contributors","subscribers_url":"https://api.github.com/repos/playframework/playframework/subscribers","subscription_url":"https://api.github.com/repos/playframework/playframework/subscription","commits_url":"https://api.github.com/repos/playframework/playframework/commits{/sha}","git_commits_url":"https://api.github.com/repos/playframework/playframework/git/commits{/sha}","comments_url":"https://api.github.com/repos/playframework/playframework/comments{/number}","issue_comment_url":"https://api.github.com/repos/playframework/playframework/issues/comments{/number}","contents_url":"https://api.github.com/repos/playframework/playframework/contents/{+path}","compare_url":"https://api.github.com/repos/playframework/playframework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/playframework/playframework/merges","archive_url":"https://api.github.com/repos/playframework/playframework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/playframework/playframework/downloads","issues_url":"https://api.github.com/repos/playframework/playframework/issues{/number}","pulls_url":"https://api.github.com/repos/playframework/playframework/pulls{/number}","milestones_url":"https://api.github.com/repos/playframework/playframework/milestones{/number}","notifications_url":"https://api.github.com/repos/playframework/playframework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/playframework/playframework/labels{/name}","releases_url":"https://api.github.com/repos/playframework/playframework/releases{/id}","deployments_url":"https://api.github.com/repos/playframework/playframework/deployments","created_at":"2011-09-07T09:24:08Z","updated_at":"2016-03-12T16:26:20Z","pushed_at":"2016-03-12T17:20:09Z","git_url":"git://github.com/playframework/playframework.git","ssh_url":"git@github.com:playframework/playframework.git","clone_url":"https://github.com/playframework/playframework.git","svn_url":"https://github.com/playframework/playframework","homepage":"http://www.playframework.com/","size":92460,"stargazers_count":7559,"watchers_count":7559,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2658,"mirror_url":null,"open_issues_count":292,"forks":2658,"open_issues":292,"watchers":7559,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/playframework/playframework/pulls/5698"},"html":{"href":"https://github.com/playframework/playframework/pull/5698"},"issue":{"href":"https://api.github.com/repos/playframework/playframework/issues/5698"},"comments":{"href":"https://api.github.com/repos/playframework/playframework/issues/5698/comments"},"review_comments":{"href":"https://api.github.com/repos/playframework/playframework/pulls/5698/comments"},"review_comment":{"href":"https://api.github.com/repos/playframework/playframework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/playframework/playframework/pulls/5698/commits"},"statuses":{"href":"https://api.github.com/repos/playframework/playframework/statuses/94b70fb1397cf37b21e78de9ad2d68b40c6227cf"}}}}