{"action":"closed","number":29,"pull_request":{"url":"https://api.github.com/repos/Mashape/httpsnippet/pulls/29","id":31130348,"html_url":"https://github.com/Mashape/httpsnippet/pull/29","diff_url":"https://github.com/Mashape/httpsnippet/pull/29.diff","patch_url":"https://github.com/Mashape/httpsnippet/pull/29.patch","issue_url":"https://api.github.com/repos/Mashape/httpsnippet/issues/29","number":29,"state":"closed","locked":false,"title":"Use proper quoting in HTTPie shell commands","user":{"login":"jakubroztocil","id":326885,"avatar_url":"https://avatars.githubusercontent.com/u/326885?v=3","gravatar_id":"","url":"https://api.github.com/users/jakubroztocil","html_url":"https://github.com/jakubroztocil","followers_url":"https://api.github.com/users/jakubroztocil/followers","following_url":"https://api.github.com/users/jakubroztocil/following{/other_user}","gists_url":"https://api.github.com/users/jakubroztocil/gists{/gist_id}","starred_url":"https://api.github.com/users/jakubroztocil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakubroztocil/subscriptions","organizations_url":"https://api.github.com/users/jakubroztocil/orgs","repos_url":"https://api.github.com/users/jakubroztocil/repos","events_url":"https://api.github.com/users/jakubroztocil/events{/privacy}","received_events_url":"https://api.github.com/users/jakubroztocil/received_events","type":"User","site_admin":false},"body":"This looks like an interesting project :+1: I've noticed a problem with quoting of the shell commands and this pull request fixes that for HTTPie:\r\n\r\nBefore, the resultant shell command was completely unquoted. This change introduces proper quoting of values and the URL - when necessary.\r\n\r\n It uses single quotes which provide \"[strong quoting](http://wiki.bash-hackers.org/syntax/quoting#strong_quoting)\" (only nested single quote characters need to be taken care of)  and  also make the output more readable as double quotes, ubiquitous in JSON, don't require escaping.\r\n\r\nBefore:\r\n\r\n```bash\r\n echo \"{\\\"foo\\\": \\\"bar\\\"}\" |  \\ \r\n  http POST http://mockbin.com/request?foo=bar&foo=baz \\\r\n  accept:application/json \\\r\n  content-type:application/json \\\r\n  cookie:foo=bar; bar=baz\r\n```\r\n\r\nAfter:\r\n\r\n```bash\r\n  echo '{\"foo\": \"bar\"}' |  \\                                  # Improved readability\r\n    http POST 'http://mockbin.com/request?foo=bar&foo=baz' \\  # Quoted \"&\"\r\n    accept:application/json \\                                 # No quoting necessary\r\n    content-type:application/json \\                           # No quoting necessary\r\n    cookie:'foo=bar; bar=baz'                                 # Quoted \";\"\r\n```\r\n\r\n----\r\n\r\nThe cURL command (and possible also Wget) most likely suffer from improper quoting as well. It's not completely missing, as was the case of HTTPie, but it uses double quotes so literals like `\"foo bar $HOME baz\"` might get expanded by the shell. I think the same quoting mechanism should be used there as well.","created_at":"2015-03-13T14:32:39Z","updated_at":"2015-03-17T03:47:34Z","closed_at":"2015-03-17T03:47:34Z","merged_at":"2015-03-17T03:47:34Z","merge_commit_sha":"a1893fc3fd2a1eb4a8aeff275edaf2b28dd40db5","assignee":{"login":"ahmadnassri","id":183195,"avatar_url":"https://avatars.githubusercontent.com/u/183195?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmadnassri","html_url":"https://github.com/ahmadnassri","followers_url":"https://api.github.com/users/ahmadnassri/followers","following_url":"https://api.github.com/users/ahmadnassri/following{/other_user}","gists_url":"https://api.github.com/users/ahmadnassri/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmadnassri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmadnassri/subscriptions","organizations_url":"https://api.github.com/users/ahmadnassri/orgs","repos_url":"https://api.github.com/users/ahmadnassri/repos","events_url":"https://api.github.com/users/ahmadnassri/events{/privacy}","received_events_url":"https://api.github.com/users/ahmadnassri/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Mashape/httpsnippet/pulls/29/commits","review_comments_url":"https://api.github.com/repos/Mashape/httpsnippet/pulls/29/comments","review_comment_url":"https://api.github.com/repos/Mashape/httpsnippet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Mashape/httpsnippet/issues/29/comments","statuses_url":"https://api.github.com/repos/Mashape/httpsnippet/statuses/25c3570286a05d3a8b10c260dd826eacbab6b8eb","head":{"label":"jakubroztocil:master","ref":"master","sha":"25c3570286a05d3a8b10c260dd826eacbab6b8eb","user":{"login":"jakubroztocil","id":326885,"avatar_url":"https://avatars.githubusercontent.com/u/326885?v=3","gravatar_id":"","url":"https://api.github.com/users/jakubroztocil","html_url":"https://github.com/jakubroztocil","followers_url":"https://api.github.com/users/jakubroztocil/followers","following_url":"https://api.github.com/users/jakubroztocil/following{/other_user}","gists_url":"https://api.github.com/users/jakubroztocil/gists{/gist_id}","starred_url":"https://api.github.com/users/jakubroztocil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakubroztocil/subscriptions","organizations_url":"https://api.github.com/users/jakubroztocil/orgs","repos_url":"https://api.github.com/users/jakubroztocil/repos","events_url":"https://api.github.com/users/jakubroztocil/events{/privacy}","received_events_url":"https://api.github.com/users/jakubroztocil/received_events","type":"User","site_admin":false},"repo":{"id":32154682,"name":"httpsnippet","full_name":"jakubroztocil/httpsnippet","owner":{"login":"jakubroztocil","id":326885,"avatar_url":"https://avatars.githubusercontent.com/u/326885?v=3","gravatar_id":"","url":"https://api.github.com/users/jakubroztocil","html_url":"https://github.com/jakubroztocil","followers_url":"https://api.github.com/users/jakubroztocil/followers","following_url":"https://api.github.com/users/jakubroztocil/following{/other_user}","gists_url":"https://api.github.com/users/jakubroztocil/gists{/gist_id}","starred_url":"https://api.github.com/users/jakubroztocil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakubroztocil/subscriptions","organizations_url":"https://api.github.com/users/jakubroztocil/orgs","repos_url":"https://api.github.com/users/jakubroztocil/repos","events_url":"https://api.github.com/users/jakubroztocil/events{/privacy}","received_events_url":"https://api.github.com/users/jakubroztocil/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jakubroztocil/httpsnippet","description":"HTTP Request snippet generator for many languages & libraries","fork":true,"url":"https://api.github.com/repos/jakubroztocil/httpsnippet","forks_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/forks","keys_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/teams","hooks_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/hooks","issue_events_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/issues/events{/number}","events_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/events","assignees_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/assignees{/user}","branches_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/branches{/branch}","tags_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/tags","blobs_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/git/refs{/sha}","trees_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/statuses/{sha}","languages_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/languages","stargazers_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/stargazers","contributors_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/contributors","subscribers_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/subscribers","subscription_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/subscription","commits_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/commits{/sha}","git_commits_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/git/commits{/sha}","comments_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/comments{/number}","issue_comment_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/issues/comments{/number}","contents_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/contents/{+path}","compare_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/merges","archive_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/downloads","issues_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/issues{/number}","pulls_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/pulls{/number}","milestones_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/milestones{/number}","notifications_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/labels{/name}","releases_url":"https://api.github.com/repos/jakubroztocil/httpsnippet/releases{/id}","created_at":"2015-03-13T12:30:07Z","updated_at":"2015-03-13T14:18:29Z","pushed_at":"2015-03-13T14:18:29Z","git_url":"git://github.com/jakubroztocil/httpsnippet.git","ssh_url":"git@github.com:jakubroztocil/httpsnippet.git","clone_url":"https://github.com/jakubroztocil/httpsnippet.git","svn_url":"https://github.com/jakubroztocil/httpsnippet","homepage":"https://apiembed.com","size":896,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"Mashape:master","ref":"master","sha":"ba377be3cd5530008563703c33834adb4db1da24","user":{"login":"Mashape","id":962416,"avatar_url":"https://avatars.githubusercontent.com/u/962416?v=3","gravatar_id":"","url":"https://api.github.com/users/Mashape","html_url":"https://github.com/Mashape","followers_url":"https://api.github.com/users/Mashape/followers","following_url":"https://api.github.com/users/Mashape/following{/other_user}","gists_url":"https://api.github.com/users/Mashape/gists{/gist_id}","starred_url":"https://api.github.com/users/Mashape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mashape/subscriptions","organizations_url":"https://api.github.com/users/Mashape/orgs","repos_url":"https://api.github.com/users/Mashape/repos","events_url":"https://api.github.com/users/Mashape/events{/privacy}","received_events_url":"https://api.github.com/users/Mashape/received_events","type":"Organization","site_admin":false},"repo":{"id":30327615,"name":"httpsnippet","full_name":"Mashape/httpsnippet","owner":{"login":"Mashape","id":962416,"avatar_url":"https://avatars.githubusercontent.com/u/962416?v=3","gravatar_id":"","url":"https://api.github.com/users/Mashape","html_url":"https://github.com/Mashape","followers_url":"https://api.github.com/users/Mashape/followers","following_url":"https://api.github.com/users/Mashape/following{/other_user}","gists_url":"https://api.github.com/users/Mashape/gists{/gist_id}","starred_url":"https://api.github.com/users/Mashape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mashape/subscriptions","organizations_url":"https://api.github.com/users/Mashape/orgs","repos_url":"https://api.github.com/users/Mashape/repos","events_url":"https://api.github.com/users/Mashape/events{/privacy}","received_events_url":"https://api.github.com/users/Mashape/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Mashape/httpsnippet","description":"HTTP Request snippet generator for many languages & libraries","fork":false,"url":"https://api.github.com/repos/Mashape/httpsnippet","forks_url":"https://api.github.com/repos/Mashape/httpsnippet/forks","keys_url":"https://api.github.com/repos/Mashape/httpsnippet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mashape/httpsnippet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mashape/httpsnippet/teams","hooks_url":"https://api.github.com/repos/Mashape/httpsnippet/hooks","issue_events_url":"https://api.github.com/repos/Mashape/httpsnippet/issues/events{/number}","events_url":"https://api.github.com/repos/Mashape/httpsnippet/events","assignees_url":"https://api.github.com/repos/Mashape/httpsnippet/assignees{/user}","branches_url":"https://api.github.com/repos/Mashape/httpsnippet/branches{/branch}","tags_url":"https://api.github.com/repos/Mashape/httpsnippet/tags","blobs_url":"https://api.github.com/repos/Mashape/httpsnippet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mashape/httpsnippet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mashape/httpsnippet/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mashape/httpsnippet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mashape/httpsnippet/statuses/{sha}","languages_url":"https://api.github.com/repos/Mashape/httpsnippet/languages","stargazers_url":"https://api.github.com/repos/Mashape/httpsnippet/stargazers","contributors_url":"https://api.github.com/repos/Mashape/httpsnippet/contributors","subscribers_url":"https://api.github.com/repos/Mashape/httpsnippet/subscribers","subscription_url":"https://api.github.com/repos/Mashape/httpsnippet/subscription","commits_url":"https://api.github.com/repos/Mashape/httpsnippet/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mashape/httpsnippet/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mashape/httpsnippet/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mashape/httpsnippet/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mashape/httpsnippet/contents/{+path}","compare_url":"https://api.github.com/repos/Mashape/httpsnippet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mashape/httpsnippet/merges","archive_url":"https://api.github.com/repos/Mashape/httpsnippet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mashape/httpsnippet/downloads","issues_url":"https://api.github.com/repos/Mashape/httpsnippet/issues{/number}","pulls_url":"https://api.github.com/repos/Mashape/httpsnippet/pulls{/number}","milestones_url":"https://api.github.com/repos/Mashape/httpsnippet/milestones{/number}","notifications_url":"https://api.github.com/repos/Mashape/httpsnippet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mashape/httpsnippet/labels{/name}","releases_url":"https://api.github.com/repos/Mashape/httpsnippet/releases{/id}","created_at":"2015-02-04T23:44:13Z","updated_at":"2015-03-16T01:15:52Z","pushed_at":"2015-03-17T03:47:34Z","git_url":"git://github.com/Mashape/httpsnippet.git","ssh_url":"git@github.com:Mashape/httpsnippet.git","clone_url":"https://github.com/Mashape/httpsnippet.git","svn_url":"https://github.com/Mashape/httpsnippet","homepage":"https://apiembed.com","size":896,"stargazers_count":25,"watchers_count":25,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":5,"forks":10,"open_issues":5,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Mashape/httpsnippet/pulls/29"},"html":{"href":"https://github.com/Mashape/httpsnippet/pull/29"},"issue":{"href":"https://api.github.com/repos/Mashape/httpsnippet/issues/29"},"comments":{"href":"https://api.github.com/repos/Mashape/httpsnippet/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/Mashape/httpsnippet/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/Mashape/httpsnippet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Mashape/httpsnippet/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/Mashape/httpsnippet/statuses/25c3570286a05d3a8b10c260dd826eacbab6b8eb"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"ahmadnassri","id":183195,"avatar_url":"https://avatars.githubusercontent.com/u/183195?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmadnassri","html_url":"https://github.com/ahmadnassri","followers_url":"https://api.github.com/users/ahmadnassri/followers","following_url":"https://api.github.com/users/ahmadnassri/following{/other_user}","gists_url":"https://api.github.com/users/ahmadnassri/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmadnassri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmadnassri/subscriptions","organizations_url":"https://api.github.com/users/ahmadnassri/orgs","repos_url":"https://api.github.com/users/ahmadnassri/repos","events_url":"https://api.github.com/users/ahmadnassri/events{/privacy}","received_events_url":"https://api.github.com/users/ahmadnassri/received_events","type":"User","site_admin":false},"comments":2,"review_comments":0,"commits":1,"additions":46,"deletions":20,"changed_files":10}}