{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/osquery/pulls/comments/27925306","id":27925306,"diff_hunk":"@@ -0,0 +1,38 @@\n+/*\n+ *  Copyright (c) 2014, Facebook, Inc.\n+ *  All rights reserved.\n+ *\n+ *  This source code is licensed under the BSD-style license found in the\n+ *  LICENSE file in the root directory of this source tree. An additional grant\n+ *  of patent rights can be found in the PATENTS file in the same directory.\n+ *\n+ */\n+\n+#include <sstream>\n+\n+#include <boost/property_tree/json_parser.hpp>\n+\n+namespace pt = boost::property_tree;\n+\n+namespace osquery{\n+\n+\tstruct curl_string {\n+\t\tchar *ptr;\n+\t\tsize_t len;\n+\t};\n+\n+\tclass HTTPResponse{\n+\t\tprivate:\n+\t\t\tlong return_code;\n+\t\t\tstd::string contents;\n+\t\t\tsize_t contents_length;\n+\n+\t\tpublic:\n+\t\t\tlong getReturnCode();\n+\t\t\tstd::string getRaw();\n+\t\t\tint getJSON(pt::ptree& tree);\n+\n+\t\t\tHTTPResponse(long code);\n+\t\t\tHTTPResponse(long code, char* data, size_t length);","path":"osquery/core/http.h","position":36,"original_position":36,"commit_id":"737bb2a3d12306d11c55b2ba3ec8e0236086555a","original_commit_id":"737bb2a3d12306d11c55b2ba3ec8e0236086555a","user":{"login":"marpaia","id":927168,"avatar_url":"https://avatars.githubusercontent.com/u/927168?v=3","gravatar_id":"","url":"https://api.github.com/users/marpaia","html_url":"https://github.com/marpaia","followers_url":"https://api.github.com/users/marpaia/followers","following_url":"https://api.github.com/users/marpaia/following{/other_user}","gists_url":"https://api.github.com/users/marpaia/gists{/gist_id}","starred_url":"https://api.github.com/users/marpaia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marpaia/subscriptions","organizations_url":"https://api.github.com/users/marpaia/orgs","repos_url":"https://api.github.com/users/marpaia/repos","events_url":"https://api.github.com/users/marpaia/events{/privacy}","received_events_url":"https://api.github.com/users/marpaia/received_events","type":"User","site_admin":false},"body":"std::string and http://www.cplusplus.com/reference/string/string/size/","created_at":"2015-04-07T22:00:10Z","updated_at":"2015-04-07T22:00:10Z","html_url":"https://github.com/facebook/osquery/pull/961#discussion_r27925306","pull_request_url":"https://api.github.com/repos/facebook/osquery/pulls/961","_links":{"self":{"href":"https://api.github.com/repos/facebook/osquery/pulls/comments/27925306"},"html":{"href":"https://github.com/facebook/osquery/pull/961#discussion_r27925306"},"pull_request":{"href":"https://api.github.com/repos/facebook/osquery/pulls/961"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/osquery/pulls/961","id":32809297,"html_url":"https://github.com/facebook/osquery/pull/961","diff_url":"https://github.com/facebook/osquery/pull/961.diff","patch_url":"https://github.com/facebook/osquery/pull/961.patch","issue_url":"https://api.github.com/repos/facebook/osquery/issues/961","number":961,"state":"open","locked":false,"title":"Adding HTTP Wrappers to the API","user":{"login":"jedi22","id":2386877,"avatar_url":"https://avatars.githubusercontent.com/u/2386877?v=3","gravatar_id":"","url":"https://api.github.com/users/jedi22","html_url":"https://github.com/jedi22","followers_url":"https://api.github.com/users/jedi22/followers","following_url":"https://api.github.com/users/jedi22/following{/other_user}","gists_url":"https://api.github.com/users/jedi22/gists{/gist_id}","starred_url":"https://api.github.com/users/jedi22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedi22/subscriptions","organizations_url":"https://api.github.com/users/jedi22/orgs","repos_url":"https://api.github.com/users/jedi22/repos","events_url":"https://api.github.com/users/jedi22/events{/privacy}","received_events_url":"https://api.github.com/users/jedi22/received_events","type":"User","site_admin":false},"body":"Adding some simple HTTP wrappers to the API to facililate further feature\r\nadditions.","created_at":"2015-04-07T21:49:58Z","updated_at":"2015-04-07T22:00:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"426efd83d33c1c628e83d9ae4b5f370f48d9d692","assignee":{"login":"marpaia","id":927168,"avatar_url":"https://avatars.githubusercontent.com/u/927168?v=3","gravatar_id":"","url":"https://api.github.com/users/marpaia","html_url":"https://github.com/marpaia","followers_url":"https://api.github.com/users/marpaia/followers","following_url":"https://api.github.com/users/marpaia/following{/other_user}","gists_url":"https://api.github.com/users/marpaia/gists{/gist_id}","starred_url":"https://api.github.com/users/marpaia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marpaia/subscriptions","organizations_url":"https://api.github.com/users/marpaia/orgs","repos_url":"https://api.github.com/users/marpaia/repos","events_url":"https://api.github.com/users/marpaia/events{/privacy}","received_events_url":"https://api.github.com/users/marpaia/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/facebook/osquery/pulls/961/commits","review_comments_url":"https://api.github.com/repos/facebook/osquery/pulls/961/comments","review_comment_url":"https://api.github.com/repos/facebook/osquery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/osquery/issues/961/comments","statuses_url":"https://api.github.com/repos/facebook/osquery/statuses/737bb2a3d12306d11c55b2ba3ec8e0236086555a","head":{"label":"jedi22:http_request_core","ref":"http_request_core","sha":"737bb2a3d12306d11c55b2ba3ec8e0236086555a","user":{"login":"jedi22","id":2386877,"avatar_url":"https://avatars.githubusercontent.com/u/2386877?v=3","gravatar_id":"","url":"https://api.github.com/users/jedi22","html_url":"https://github.com/jedi22","followers_url":"https://api.github.com/users/jedi22/followers","following_url":"https://api.github.com/users/jedi22/following{/other_user}","gists_url":"https://api.github.com/users/jedi22/gists{/gist_id}","starred_url":"https://api.github.com/users/jedi22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedi22/subscriptions","organizations_url":"https://api.github.com/users/jedi22/orgs","repos_url":"https://api.github.com/users/jedi22/repos","events_url":"https://api.github.com/users/jedi22/events{/privacy}","received_events_url":"https://api.github.com/users/jedi22/received_events","type":"User","site_admin":false},"repo":{"id":29310726,"name":"osquery","full_name":"jedi22/osquery","owner":{"login":"jedi22","id":2386877,"avatar_url":"https://avatars.githubusercontent.com/u/2386877?v=3","gravatar_id":"","url":"https://api.github.com/users/jedi22","html_url":"https://github.com/jedi22","followers_url":"https://api.github.com/users/jedi22/followers","following_url":"https://api.github.com/users/jedi22/following{/other_user}","gists_url":"https://api.github.com/users/jedi22/gists{/gist_id}","starred_url":"https://api.github.com/users/jedi22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedi22/subscriptions","organizations_url":"https://api.github.com/users/jedi22/orgs","repos_url":"https://api.github.com/users/jedi22/repos","events_url":"https://api.github.com/users/jedi22/events{/privacy}","received_events_url":"https://api.github.com/users/jedi22/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jedi22/osquery","description":"SQL powered operating system instrumentation, monitoring, and analytics.","fork":true,"url":"https://api.github.com/repos/jedi22/osquery","forks_url":"https://api.github.com/repos/jedi22/osquery/forks","keys_url":"https://api.github.com/repos/jedi22/osquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jedi22/osquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jedi22/osquery/teams","hooks_url":"https://api.github.com/repos/jedi22/osquery/hooks","issue_events_url":"https://api.github.com/repos/jedi22/osquery/issues/events{/number}","events_url":"https://api.github.com/repos/jedi22/osquery/events","assignees_url":"https://api.github.com/repos/jedi22/osquery/assignees{/user}","branches_url":"https://api.github.com/repos/jedi22/osquery/branches{/branch}","tags_url":"https://api.github.com/repos/jedi22/osquery/tags","blobs_url":"https://api.github.com/repos/jedi22/osquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jedi22/osquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jedi22/osquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/jedi22/osquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jedi22/osquery/statuses/{sha}","languages_url":"https://api.github.com/repos/jedi22/osquery/languages","stargazers_url":"https://api.github.com/repos/jedi22/osquery/stargazers","contributors_url":"https://api.github.com/repos/jedi22/osquery/contributors","subscribers_url":"https://api.github.com/repos/jedi22/osquery/subscribers","subscription_url":"https://api.github.com/repos/jedi22/osquery/subscription","commits_url":"https://api.github.com/repos/jedi22/osquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/jedi22/osquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/jedi22/osquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/jedi22/osquery/issues/comments{/number}","contents_url":"https://api.github.com/repos/jedi22/osquery/contents/{+path}","compare_url":"https://api.github.com/repos/jedi22/osquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jedi22/osquery/merges","archive_url":"https://api.github.com/repos/jedi22/osquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jedi22/osquery/downloads","issues_url":"https://api.github.com/repos/jedi22/osquery/issues{/number}","pulls_url":"https://api.github.com/repos/jedi22/osquery/pulls{/number}","milestones_url":"https://api.github.com/repos/jedi22/osquery/milestones{/number}","notifications_url":"https://api.github.com/repos/jedi22/osquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jedi22/osquery/labels{/name}","releases_url":"https://api.github.com/repos/jedi22/osquery/releases{/id}","created_at":"2015-01-15T18:09:35Z","updated_at":"2015-01-29T21:46:33Z","pushed_at":"2015-04-07T21:24:20Z","git_url":"git://github.com/jedi22/osquery.git","ssh_url":"git@github.com:jedi22/osquery.git","clone_url":"https://github.com/jedi22/osquery.git","svn_url":"https://github.com/jedi22/osquery","homepage":"http://osquery.io","size":5736,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"f97ca387431bea13023951038dac89e70125a631","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","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":22394357,"name":"osquery","full_name":"facebook/osquery","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","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},"private":false,"html_url":"https://github.com/facebook/osquery","description":"SQL powered operating system instrumentation, monitoring, and analytics.","fork":false,"url":"https://api.github.com/repos/facebook/osquery","forks_url":"https://api.github.com/repos/facebook/osquery/forks","keys_url":"https://api.github.com/repos/facebook/osquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/osquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/osquery/teams","hooks_url":"https://api.github.com/repos/facebook/osquery/hooks","issue_events_url":"https://api.github.com/repos/facebook/osquery/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/osquery/events","assignees_url":"https://api.github.com/repos/facebook/osquery/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/osquery/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/osquery/tags","blobs_url":"https://api.github.com/repos/facebook/osquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/osquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/osquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/osquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/osquery/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/osquery/languages","stargazers_url":"https://api.github.com/repos/facebook/osquery/stargazers","contributors_url":"https://api.github.com/repos/facebook/osquery/contributors","subscribers_url":"https://api.github.com/repos/facebook/osquery/subscribers","subscription_url":"https://api.github.com/repos/facebook/osquery/subscription","commits_url":"https://api.github.com/repos/facebook/osquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/osquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/osquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/osquery/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/osquery/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/osquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/osquery/merges","archive_url":"https://api.github.com/repos/facebook/osquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/osquery/downloads","issues_url":"https://api.github.com/repos/facebook/osquery/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/osquery/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/osquery/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/osquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/osquery/labels{/name}","releases_url":"https://api.github.com/repos/facebook/osquery/releases{/id}","created_at":"2014-07-29T20:27:33Z","updated_at":"2015-04-07T21:49:46Z","pushed_at":"2015-04-07T21:49:58Z","git_url":"git://github.com/facebook/osquery.git","ssh_url":"git@github.com:facebook/osquery.git","clone_url":"https://github.com/facebook/osquery.git","svn_url":"https://github.com/facebook/osquery","homepage":"http://osquery.io","size":14257,"stargazers_count":3960,"watchers_count":3960,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":290,"mirror_url":null,"open_issues_count":30,"forks":290,"open_issues":30,"watchers":3960,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/osquery/pulls/961"},"html":{"href":"https://github.com/facebook/osquery/pull/961"},"issue":{"href":"https://api.github.com/repos/facebook/osquery/issues/961"},"comments":{"href":"https://api.github.com/repos/facebook/osquery/issues/961/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/osquery/pulls/961/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/osquery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/osquery/pulls/961/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/osquery/statuses/737bb2a3d12306d11c55b2ba3ec8e0236086555a"}}}}