{"action":"created","issue":{"url":"https://api.github.com/repos/CounterpartyXCP/counterpartyd/issues/712","labels_url":"https://api.github.com/repos/CounterpartyXCP/counterpartyd/issues/712/labels{/name}","comments_url":"https://api.github.com/repos/CounterpartyXCP/counterpartyd/issues/712/comments","events_url":"https://api.github.com/repos/CounterpartyXCP/counterpartyd/issues/712/events","html_url":"https://github.com/CounterpartyXCP/counterpartyd/pull/712","id":57536489,"number":712,"title":"[#566] [#687] HTTP REST API","user":{"login":"Millz0r","id":5749126,"avatar_url":"https://avatars.githubusercontent.com/u/5749126?v=3","gravatar_id":"","url":"https://api.github.com/users/Millz0r","html_url":"https://github.com/Millz0r","followers_url":"https://api.github.com/users/Millz0r/followers","following_url":"https://api.github.com/users/Millz0r/following{/other_user}","gists_url":"https://api.github.com/users/Millz0r/gists{/gist_id}","starred_url":"https://api.github.com/users/Millz0r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Millz0r/subscriptions","organizations_url":"https://api.github.com/users/Millz0r/orgs","repos_url":"https://api.github.com/users/Millz0r/repos","events_url":"https://api.github.com/users/Millz0r/events{/privacy}","received_events_url":"https://api.github.com/users/Millz0r/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-12T23:28:16Z","updated_at":"2015-02-13T10:01:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CounterpartyXCP/counterpartyd/pulls/712","html_url":"https://github.com/CounterpartyXCP/counterpartyd/pull/712","diff_url":"https://github.com/CounterpartyXCP/counterpartyd/pull/712.diff","patch_url":"https://github.com/CounterpartyXCP/counterpartyd/pull/712.patch"},"body":"Solves #566 and #687.\r\n\r\n- All API calls go through a single handler now.\r\n- New GET /rest/ call as an interface to get_rows database queries.\r\n- New POST /rest/ call as an interface to compose_transaction calls.\r\n- JSON-RPC doesn't listen on / anymore (that access route not documented anyway).\r\n- RPC_PASSWORD config setting is no longer mandatory.\r\n- Adds xmltodict requirement.\r\n\r\nThe API is documented here for now:\r\nhttp://docs.counterpartylib.apiary.io/#"},"comment":{"url":"https://api.github.com/repos/CounterpartyXCP/counterpartyd/issues/comments/74230523","html_url":"https://github.com/CounterpartyXCP/counterpartyd/pull/712#issuecomment-74230523","issue_url":"https://api.github.com/repos/CounterpartyXCP/counterpartyd/issues/712","id":74230523,"user":{"login":"ouziel-slama","id":4574979,"avatar_url":"https://avatars.githubusercontent.com/u/4574979?v=3","gravatar_id":"","url":"https://api.github.com/users/ouziel-slama","html_url":"https://github.com/ouziel-slama","followers_url":"https://api.github.com/users/ouziel-slama/followers","following_url":"https://api.github.com/users/ouziel-slama/following{/other_user}","gists_url":"https://api.github.com/users/ouziel-slama/gists{/gist_id}","starred_url":"https://api.github.com/users/ouziel-slama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ouziel-slama/subscriptions","organizations_url":"https://api.github.com/users/ouziel-slama/orgs","repos_url":"https://api.github.com/users/ouziel-slama/repos","events_url":"https://api.github.com/users/ouziel-slama/events{/privacy}","received_events_url":"https://api.github.com/users/ouziel-slama/received_events","type":"User","site_admin":false},"created_at":"2015-02-13T10:01:26Z","updated_at":"2015-02-13T10:01:26Z","body":"Some nitpicking:\r\n\r\n1) REST url should contains resource names and ID's, and the last part can eventually be an \"action\". The action parameters should be in the query string. If you consider an address as a resource, we can have something like:\r\n`/rest/source/mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc/compose?destination=mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns&quantity=3&asset=XCP`\r\nTo be really REST, this query, to compose a transaction, should be used with GET method (POST is used when there is something written in the database). BUT in our case I think we should ALSO accept POST for privacy (POST query string can be crypted with SSL).\r\n\r\n2)  `handle_rest_get` and `handle_rest_post` are very similar! Do you think it's possible to DRY a little bit this 2 functions ?"}}