{"action":"created","issue":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/1502","labels_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/1502/labels{/name}","comments_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/1502/comments","events_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/1502/events","html_url":"https://github.com/Project-OSRM/osrm-backend/pull/1502","id":81938304,"number":1502,"title":"Accepting HTTP Post Request","user":{"login":"agruss","id":12281156,"avatar_url":"https://avatars.githubusercontent.com/u/12281156?v=3","gravatar_id":"","url":"https://api.github.com/users/agruss","html_url":"https://github.com/agruss","followers_url":"https://api.github.com/users/agruss/followers","following_url":"https://api.github.com/users/agruss/following{/other_user}","gists_url":"https://api.github.com/users/agruss/gists{/gist_id}","starred_url":"https://api.github.com/users/agruss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agruss/subscriptions","organizations_url":"https://api.github.com/users/agruss/orgs","repos_url":"https://api.github.com/users/agruss/repos","events_url":"https://api.github.com/users/agruss/events{/privacy}","received_events_url":"https://api.github.com/users/agruss/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/milestones/5","html_url":"https://github.com/Project-OSRM/osrm-backend/milestones/4.7.0","labels_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/milestones/5/labels","id":1078647,"number":5,"title":"4.7.0","description":null,"creator":{"login":"TheMarex","id":606968,"avatar_url":"https://avatars.githubusercontent.com/u/606968?v=3","gravatar_id":"","url":"https://api.github.com/users/TheMarex","html_url":"https://github.com/TheMarex","followers_url":"https://api.github.com/users/TheMarex/followers","following_url":"https://api.github.com/users/TheMarex/following{/other_user}","gists_url":"https://api.github.com/users/TheMarex/gists{/gist_id}","starred_url":"https://api.github.com/users/TheMarex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheMarex/subscriptions","organizations_url":"https://api.github.com/users/TheMarex/orgs","repos_url":"https://api.github.com/users/TheMarex/repos","events_url":"https://api.github.com/users/TheMarex/events{/privacy}","received_events_url":"https://api.github.com/users/TheMarex/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":10,"state":"open","created_at":"2015-04-22T10:32:16Z","updated_at":"2015-06-03T08:29:45Z","due_on":null,"closed_at":null},"comments":17,"created_at":"2015-05-28T13:58:29Z","updated_at":"2015-06-04T18:15:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/pulls/1502","html_url":"https://github.com/Project-OSRM/osrm-backend/pull/1502","diff_url":"https://github.com/Project-OSRM/osrm-backend/pull/1502.diff","patch_url":"https://github.com/Project-OSRM/osrm-backend/pull/1502.patch"},"body":"This is a solution for accepting HTTP post requests. You can send them described as here: http://en.wikipedia.org/wiki/POST_%28HTTP%29#Use_for_submitting_web_forms\r\n\r\nStill missing are tests for the test suite (there seems to be some problems with the methods, the only way to send a post request is via post_form() which malformed the requests)."},"comment":{"url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/comments/108996818","html_url":"https://github.com/Project-OSRM/osrm-backend/pull/1502#issuecomment-108996818","issue_url":"https://api.github.com/repos/Project-OSRM/osrm-backend/issues/1502","id":108996818,"user":{"login":"emiltin","id":66034,"avatar_url":"https://avatars.githubusercontent.com/u/66034?v=3","gravatar_id":"","url":"https://api.github.com/users/emiltin","html_url":"https://github.com/emiltin","followers_url":"https://api.github.com/users/emiltin/followers","following_url":"https://api.github.com/users/emiltin/following{/other_user}","gists_url":"https://api.github.com/users/emiltin/gists{/gist_id}","starred_url":"https://api.github.com/users/emiltin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emiltin/subscriptions","organizations_url":"https://api.github.com/users/emiltin/orgs","repos_url":"https://api.github.com/users/emiltin/repos","events_url":"https://api.github.com/users/emiltin/events{/privacy}","received_events_url":"https://api.github.com/users/emiltin/received_events","type":"User","site_admin":false},"created_at":"2015-06-04T18:15:31Z","updated_at":"2015-06-04T18:15:31Z","body":"better!\r\nbut i think it can be improved a bit more by defining something like:\r\n\r\n```ruby\r\nGiven /^the HTTP method \"([^\"]*)\"$/ do |method|\r\n  @http_method = method\r\nend\r\n```\r\n\r\nthat way you can use it like below. note that you can place it in the background section if you want to use it for all scenarios in the feature file:\r\n\r\n```gherkin\r\n    Background:\r\n        Given the profile \"testbot\"\r\n        And the HTTP method \"POST\"\r\n```\r\n\r\nalso the code that handles post/get is still duplicated, and should preferable be factored out to a common class or method.\r\n\r\n"}}