{"action":"created","comment":{"url":"https://api.github.com/repos/ScottNeaves/curl-builder/pulls/comments/58710338","id":58710338,"diff_hunk":"@@ -17,16 +21,26 @@ function ViewModel() {\n     value: ko.observable(\"\")\n   }, ]);\n \n+  self.headers = ko.observableArray([{\n+    key: ko.observable(\"\"),\n+    value: ko.observable(\"\")\n+  }, ]);\n \n   self.curlCommand = ko.computed(function() {\n-    return self.queryParams()[0].key() + \" \" + self.dataPayload() + \" \" + self.methodType() + \" \" + self.url()\n+    this.queryParameters = \"?\"\n+    for (var i = 0; i < self.queryParams().length; i++){\n+      this.queryParameters = this.queryParameters + self.queryParams()[i].key() + \"=\" + self.queryParams()[i].value() +\"&\"\n+    }\n+\n+    this.headers = \"\"\n+    for (var i = 0; i < self.headers().length; i++){\n+      this.headers = this.headers + \" --header \\\"\" + self.headers()[i].key() + \": \" + self.headers()[i].value() + \"\\\"\"\n+    }\n+    return \"curl \" + this.headers + \" \" + self.url() + this.queryParameters + \" \" + self.dataPayload() + \" \" + self.methodType()","path":"static/js/script.js","position":28,"original_position":28,"commit_id":"a7767948a328593b6daa92d6a01f75595f4d996b","original_commit_id":"a7767948a328593b6daa92d6a01f75595f4d996b","user":{"login":"ScottNeaves","id":1520622,"avatar_url":"https://avatars.githubusercontent.com/u/1520622?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottNeaves","html_url":"https://github.com/ScottNeaves","followers_url":"https://api.github.com/users/ScottNeaves/followers","following_url":"https://api.github.com/users/ScottNeaves/following{/other_user}","gists_url":"https://api.github.com/users/ScottNeaves/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottNeaves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottNeaves/subscriptions","organizations_url":"https://api.github.com/users/ScottNeaves/orgs","repos_url":"https://api.github.com/users/ScottNeaves/repos","events_url":"https://api.github.com/users/ScottNeaves/events{/privacy}","received_events_url":"https://api.github.com/users/ScottNeaves/received_events","type":"User","site_admin":false},"body":"curl --verbose --header \"key: value\" --data \"<data payload goes here>\" --request <method type goes here> www.google.com?key1=value1&key2=value2","created_at":"2016-04-06T14:04:20Z","updated_at":"2016-04-06T14:04:20Z","html_url":"https://github.com/ScottNeaves/curl-builder/pull/11#discussion_r58710338","pull_request_url":"https://api.github.com/repos/ScottNeaves/curl-builder/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/ScottNeaves/curl-builder/pulls/comments/58710338"},"html":{"href":"https://github.com/ScottNeaves/curl-builder/pull/11#discussion_r58710338"},"pull_request":{"href":"https://api.github.com/repos/ScottNeaves/curl-builder/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/ScottNeaves/curl-builder/pulls/11","id":65468703,"html_url":"https://github.com/ScottNeaves/curl-builder/pull/11","diff_url":"https://github.com/ScottNeaves/curl-builder/pull/11.diff","patch_url":"https://github.com/ScottNeaves/curl-builder/pull/11.patch","issue_url":"https://api.github.com/repos/ScottNeaves/curl-builder/issues/11","number":11,"state":"open","locked":false,"title":"Proper curl command","user":{"login":"blink2ce","id":2014566,"avatar_url":"https://avatars.githubusercontent.com/u/2014566?v=3","gravatar_id":"","url":"https://api.github.com/users/blink2ce","html_url":"https://github.com/blink2ce","followers_url":"https://api.github.com/users/blink2ce/followers","following_url":"https://api.github.com/users/blink2ce/following{/other_user}","gists_url":"https://api.github.com/users/blink2ce/gists{/gist_id}","starred_url":"https://api.github.com/users/blink2ce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blink2ce/subscriptions","organizations_url":"https://api.github.com/users/blink2ce/orgs","repos_url":"https://api.github.com/users/blink2ce/repos","events_url":"https://api.github.com/users/blink2ce/events{/privacy}","received_events_url":"https://api.github.com/users/blink2ce/received_events","type":"User","site_admin":false},"body":"Added proper syntax for header and query parameter sections so it shows up nicely in the curl command.\r\n\r\nAlso, added the Ace editor field.","created_at":"2016-04-06T13:46:43Z","updated_at":"2016-04-06T14:04:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"95c435bdabf619501d54f8be18e8512e5f08b9c8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ScottNeaves/curl-builder/pulls/11/commits","review_comments_url":"https://api.github.com/repos/ScottNeaves/curl-builder/pulls/11/comments","review_comment_url":"https://api.github.com/repos/ScottNeaves/curl-builder/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ScottNeaves/curl-builder/issues/11/comments","statuses_url":"https://api.github.com/repos/ScottNeaves/curl-builder/statuses/a7767948a328593b6daa92d6a01f75595f4d996b","head":{"label":"ScottNeaves:proper-curl-command","ref":"proper-curl-command","sha":"a7767948a328593b6daa92d6a01f75595f4d996b","user":{"login":"ScottNeaves","id":1520622,"avatar_url":"https://avatars.githubusercontent.com/u/1520622?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottNeaves","html_url":"https://github.com/ScottNeaves","followers_url":"https://api.github.com/users/ScottNeaves/followers","following_url":"https://api.github.com/users/ScottNeaves/following{/other_user}","gists_url":"https://api.github.com/users/ScottNeaves/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottNeaves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottNeaves/subscriptions","organizations_url":"https://api.github.com/users/ScottNeaves/orgs","repos_url":"https://api.github.com/users/ScottNeaves/repos","events_url":"https://api.github.com/users/ScottNeaves/events{/privacy}","received_events_url":"https://api.github.com/users/ScottNeaves/received_events","type":"User","site_admin":false},"repo":{"id":54227854,"name":"curl-builder","full_name":"ScottNeaves/curl-builder","owner":{"login":"ScottNeaves","id":1520622,"avatar_url":"https://avatars.githubusercontent.com/u/1520622?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottNeaves","html_url":"https://github.com/ScottNeaves","followers_url":"https://api.github.com/users/ScottNeaves/followers","following_url":"https://api.github.com/users/ScottNeaves/following{/other_user}","gists_url":"https://api.github.com/users/ScottNeaves/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottNeaves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottNeaves/subscriptions","organizations_url":"https://api.github.com/users/ScottNeaves/orgs","repos_url":"https://api.github.com/users/ScottNeaves/repos","events_url":"https://api.github.com/users/ScottNeaves/events{/privacy}","received_events_url":"https://api.github.com/users/ScottNeaves/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ScottNeaves/curl-builder","description":"Builds curl commands","fork":false,"url":"https://api.github.com/repos/ScottNeaves/curl-builder","forks_url":"https://api.github.com/repos/ScottNeaves/curl-builder/forks","keys_url":"https://api.github.com/repos/ScottNeaves/curl-builder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ScottNeaves/curl-builder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ScottNeaves/curl-builder/teams","hooks_url":"https://api.github.com/repos/ScottNeaves/curl-builder/hooks","issue_events_url":"https://api.github.com/repos/ScottNeaves/curl-builder/issues/events{/number}","events_url":"https://api.github.com/repos/ScottNeaves/curl-builder/events","assignees_url":"https://api.github.com/repos/ScottNeaves/curl-builder/assignees{/user}","branches_url":"https://api.github.com/repos/ScottNeaves/curl-builder/branches{/branch}","tags_url":"https://api.github.com/repos/ScottNeaves/curl-builder/tags","blobs_url":"https://api.github.com/repos/ScottNeaves/curl-builder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ScottNeaves/curl-builder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ScottNeaves/curl-builder/git/refs{/sha}","trees_url":"https://api.github.com/repos/ScottNeaves/curl-builder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ScottNeaves/curl-builder/statuses/{sha}","languages_url":"https://api.github.com/repos/ScottNeaves/curl-builder/languages","stargazers_url":"https://api.github.com/repos/ScottNeaves/curl-builder/stargazers","contributors_url":"https://api.github.com/repos/ScottNeaves/curl-builder/contributors","subscribers_url":"https://api.github.com/repos/ScottNeaves/curl-builder/subscribers","subscription_url":"https://api.github.com/repos/ScottNeaves/curl-builder/subscription","commits_url":"https://api.github.com/repos/ScottNeaves/curl-builder/commits{/sha}","git_commits_url":"https://api.github.com/repos/ScottNeaves/curl-builder/git/commits{/sha}","comments_url":"https://api.github.com/repos/ScottNeaves/curl-builder/comments{/number}","issue_comment_url":"https://api.github.com/repos/ScottNeaves/curl-builder/issues/comments{/number}","contents_url":"https://api.github.com/repos/ScottNeaves/curl-builder/contents/{+path}","compare_url":"https://api.github.com/repos/ScottNeaves/curl-builder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ScottNeaves/curl-builder/merges","archive_url":"https://api.github.com/repos/ScottNeaves/curl-builder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ScottNeaves/curl-builder/downloads","issues_url":"https://api.github.com/repos/ScottNeaves/curl-builder/issues{/number}","pulls_url":"https://api.github.com/repos/ScottNeaves/curl-builder/pulls{/number}","milestones_url":"https://api.github.com/repos/ScottNeaves/curl-builder/milestones{/number}","notifications_url":"https://api.github.com/repos/ScottNeaves/curl-builder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ScottNeaves/curl-builder/labels{/name}","releases_url":"https://api.github.com/repos/ScottNeaves/curl-builder/releases{/id}","deployments_url":"https://api.github.com/repos/ScottNeaves/curl-builder/deployments","created_at":"2016-03-18T19:54:07Z","updated_at":"2016-03-18T21:10:08Z","pushed_at":"2016-04-06T13:46:45Z","git_url":"git://github.com/ScottNeaves/curl-builder.git","ssh_url":"git@github.com:ScottNeaves/curl-builder.git","clone_url":"https://github.com/ScottNeaves/curl-builder.git","svn_url":"https://github.com/ScottNeaves/curl-builder","homepage":null,"size":164,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"ScottNeaves:master","ref":"master","sha":"21fb157af62d5ee65263aa6a81593835e4a7b38e","user":{"login":"ScottNeaves","id":1520622,"avatar_url":"https://avatars.githubusercontent.com/u/1520622?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottNeaves","html_url":"https://github.com/ScottNeaves","followers_url":"https://api.github.com/users/ScottNeaves/followers","following_url":"https://api.github.com/users/ScottNeaves/following{/other_user}","gists_url":"https://api.github.com/users/ScottNeaves/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottNeaves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottNeaves/subscriptions","organizations_url":"https://api.github.com/users/ScottNeaves/orgs","repos_url":"https://api.github.com/users/ScottNeaves/repos","events_url":"https://api.github.com/users/ScottNeaves/events{/privacy}","received_events_url":"https://api.github.com/users/ScottNeaves/received_events","type":"User","site_admin":false},"repo":{"id":54227854,"name":"curl-builder","full_name":"ScottNeaves/curl-builder","owner":{"login":"ScottNeaves","id":1520622,"avatar_url":"https://avatars.githubusercontent.com/u/1520622?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottNeaves","html_url":"https://github.com/ScottNeaves","followers_url":"https://api.github.com/users/ScottNeaves/followers","following_url":"https://api.github.com/users/ScottNeaves/following{/other_user}","gists_url":"https://api.github.com/users/ScottNeaves/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottNeaves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottNeaves/subscriptions","organizations_url":"https://api.github.com/users/ScottNeaves/orgs","repos_url":"https://api.github.com/users/ScottNeaves/repos","events_url":"https://api.github.com/users/ScottNeaves/events{/privacy}","received_events_url":"https://api.github.com/users/ScottNeaves/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ScottNeaves/curl-builder","description":"Builds curl commands","fork":false,"url":"https://api.github.com/repos/ScottNeaves/curl-builder","forks_url":"https://api.github.com/repos/ScottNeaves/curl-builder/forks","keys_url":"https://api.github.com/repos/ScottNeaves/curl-builder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ScottNeaves/curl-builder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ScottNeaves/curl-builder/teams","hooks_url":"https://api.github.com/repos/ScottNeaves/curl-builder/hooks","issue_events_url":"https://api.github.com/repos/ScottNeaves/curl-builder/issues/events{/number}","events_url":"https://api.github.com/repos/ScottNeaves/curl-builder/events","assignees_url":"https://api.github.com/repos/ScottNeaves/curl-builder/assignees{/user}","branches_url":"https://api.github.com/repos/ScottNeaves/curl-builder/branches{/branch}","tags_url":"https://api.github.com/repos/ScottNeaves/curl-builder/tags","blobs_url":"https://api.github.com/repos/ScottNeaves/curl-builder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ScottNeaves/curl-builder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ScottNeaves/curl-builder/git/refs{/sha}","trees_url":"https://api.github.com/repos/ScottNeaves/curl-builder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ScottNeaves/curl-builder/statuses/{sha}","languages_url":"https://api.github.com/repos/ScottNeaves/curl-builder/languages","stargazers_url":"https://api.github.com/repos/ScottNeaves/curl-builder/stargazers","contributors_url":"https://api.github.com/repos/ScottNeaves/curl-builder/contributors","subscribers_url":"https://api.github.com/repos/ScottNeaves/curl-builder/subscribers","subscription_url":"https://api.github.com/repos/ScottNeaves/curl-builder/subscription","commits_url":"https://api.github.com/repos/ScottNeaves/curl-builder/commits{/sha}","git_commits_url":"https://api.github.com/repos/ScottNeaves/curl-builder/git/commits{/sha}","comments_url":"https://api.github.com/repos/ScottNeaves/curl-builder/comments{/number}","issue_comment_url":"https://api.github.com/repos/ScottNeaves/curl-builder/issues/comments{/number}","contents_url":"https://api.github.com/repos/ScottNeaves/curl-builder/contents/{+path}","compare_url":"https://api.github.com/repos/ScottNeaves/curl-builder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ScottNeaves/curl-builder/merges","archive_url":"https://api.github.com/repos/ScottNeaves/curl-builder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ScottNeaves/curl-builder/downloads","issues_url":"https://api.github.com/repos/ScottNeaves/curl-builder/issues{/number}","pulls_url":"https://api.github.com/repos/ScottNeaves/curl-builder/pulls{/number}","milestones_url":"https://api.github.com/repos/ScottNeaves/curl-builder/milestones{/number}","notifications_url":"https://api.github.com/repos/ScottNeaves/curl-builder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ScottNeaves/curl-builder/labels{/name}","releases_url":"https://api.github.com/repos/ScottNeaves/curl-builder/releases{/id}","deployments_url":"https://api.github.com/repos/ScottNeaves/curl-builder/deployments","created_at":"2016-03-18T19:54:07Z","updated_at":"2016-03-18T21:10:08Z","pushed_at":"2016-04-06T13:46:45Z","git_url":"git://github.com/ScottNeaves/curl-builder.git","ssh_url":"git@github.com:ScottNeaves/curl-builder.git","clone_url":"https://github.com/ScottNeaves/curl-builder.git","svn_url":"https://github.com/ScottNeaves/curl-builder","homepage":null,"size":164,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ScottNeaves/curl-builder/pulls/11"},"html":{"href":"https://github.com/ScottNeaves/curl-builder/pull/11"},"issue":{"href":"https://api.github.com/repos/ScottNeaves/curl-builder/issues/11"},"comments":{"href":"https://api.github.com/repos/ScottNeaves/curl-builder/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/ScottNeaves/curl-builder/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/ScottNeaves/curl-builder/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ScottNeaves/curl-builder/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/ScottNeaves/curl-builder/statuses/a7767948a328593b6daa92d6a01f75595f4d996b"}}}}