{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-boston/game-project/issues/593","repository_url":"https://api.github.com/repos/ga-wdi-boston/game-project","labels_url":"https://api.github.com/repos/ga-wdi-boston/game-project/issues/593/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-boston/game-project/issues/593/comments","events_url":"https://api.github.com/repos/ga-wdi-boston/game-project/issues/593/events","html_url":"https://github.com/ga-wdi-boston/game-project/issues/593","id":221119302,"number":593,"title":"curl request for Game API 'create' not working","user":{"login":"nriser","id":16979795,"avatar_url":"https://avatars1.githubusercontent.com/u/16979795?v=3","gravatar_id":"","url":"https://api.github.com/users/nriser","html_url":"https://github.com/nriser","followers_url":"https://api.github.com/users/nriser/followers","following_url":"https://api.github.com/users/nriser/following{/other_user}","gists_url":"https://api.github.com/users/nriser/gists{/gist_id}","starred_url":"https://api.github.com/users/nriser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nriser/subscriptions","organizations_url":"https://api.github.com/users/nriser/orgs","repos_url":"https://api.github.com/users/nriser/repos","events_url":"https://api.github.com/users/nriser/events{/privacy}","received_events_url":"https://api.github.com/users/nriser/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-04-12T00:39:34Z","updated_at":"2017-04-12T15:06:40Z","closed_at":null,"body":"I'm trying to make my curl request for the create game request, but I keep getting a 404 Not Found response. I've tried two ways, one with POST (as it's written in the game api project repo), and another with GET. The token and ID were retrieved after I signed in.  I apologize in advance if I'm missing any other info! I'd appreciate any feedback. \r\n\r\ncurl request in project-tictactoe/scripts/game-create.sh: \r\n```\r\n#!/bin/bash\r\ncurl --include --request POST http://localhost:4741/games/$ID \\\r\n  --header \"Authorization: Token token=$TOKEN\" \\\r\n  --data ''\r\n\r\n  echo\r\n```\r\nerror message on grunt server: \r\n```\r\nStarted POST \"/games/15\" for ::1 at 2017-04-11 19:47:04 -0400\r\n\r\nActionController::RoutingError (No route matches [POST] \"/games/15\"):\r\n  actionpack (4.2.7.1) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'\r\n  actionpack (4.2.7.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'\r\n  railties (4.2.7.1) lib/rails/rack/logger.rb:38:in `call_app'\r\n  railties (4.2.7.1) lib/rails/rack/logger.rb:20:in `block in call'\r\n  activesupport (4.2.7.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'\r\n  activesupport (4.2.7.1) lib/active_support/tagged_logging.rb:26:in `tagged'\r\n  activesupport (4.2.7.1) lib/active_support/tagged_logging.rb:68:in `tagged'\r\n  railties (4.2.7.1) lib/rails/rack/logger.rb:20:in `call'\r\n  actionpack (4.2.7.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'\r\n  rack (1.6.4) lib/rack/runtime.rb:18:in `call'\r\n  activesupport (4.2.7.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'\r\n  actionpack (4.2.7.1) lib/action_dispatch/middleware/static.rb:120:in `call'\r\n  rack-cors (0.4.0) lib/rack/cors.rb:80:in `call'\r\n  railties (4.2.7.1) lib/rails/engine.rb:518:in `call'\r\n  railties (4.2.7.1) lib/rails/application.rb:165:in `call'\r\n  rack (1.6.4) lib/rack/content_length.rb:15:in `call'\r\n  puma (3.6.0) lib/puma/configuration.rb:225:in `call'\r\n  puma (3.6.0) lib/puma/server.rb:578:in `handle_request'\r\n  puma (3.6.0) lib/puma/server.rb:415:in `process_client'\r\n  puma (3.6.0) lib/puma/server.rb:275:in `block in run'\r\n  puma (3.6.0) lib/puma/thread_pool.rb:116:in `block in spawn_thread'\r\n```\r\n\r\ncommand I run in terminal, along with the error message below:\r\n```\r\n$ ID=15 TOKEN=BAhJIiU5NzE5ZTU0ZWZlNjg2NjZlN2JiOWRjYjhlNzM4ODZhNQY6BkVG--41dee1189ccf82dc42516eea6623366857e470f6 sh scripts/game-create.sh\r\nHTTP/1.1 404 Not Found\r\nContent-Type: text/html; charset=utf-8\r\nX-Request-Id: bc2a179a-da95-4537-a84b-761eca67d271\r\nX-Runtime: 0.021777\r\nVary: Origin\r\nContent-Length: 1564\r\n\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n  <title>The page you were looking for doesn't exist (404)</title>\r\n  <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\r\n  <style>\r\n  body {\r\n    background-color: #EFEFEF;\r\n    color: #2E2F30;\r\n    text-align: center;\r\n    font-family: arial, sans-serif;\r\n    margin: 0;\r\n  }\r\n\r\n  div.dialog {\r\n    width: 95%;\r\n    max-width: 33em;\r\n    margin: 4em auto 0;\r\n  }\r\n\r\n  div.dialog > div {\r\n    border: 1px solid #CCC;\r\n    border-right-color: #999;\r\n    border-left-color: #999;\r\n    border-bottom-color: #BBB;\r\n    border-top: #B00100 solid 4px;\r\n    border-top-left-radius: 9px;\r\n    border-top-right-radius: 9px;\r\n    background-color: white;\r\n    padding: 7px 12% 0;\r\n    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);\r\n  }\r\n\r\n  h1 {\r\n    font-size: 100%;\r\n    color: #730E15;\r\n    line-height: 1.5em;\r\n  }\r\n\r\n  div.dialog > p {\r\n    margin: 0 0 1em;\r\n    padding: 1em;\r\n    background-color: #F7F7F7;\r\n    border: 1px solid #CCC;\r\n    border-right-color: #999;\r\n    border-left-color: #999;\r\n    border-bottom-color: #999;\r\n    border-bottom-left-radius: 4px;\r\n    border-bottom-right-radius: 4px;\r\n    border-top-color: #DADADA;\r\n    color: #666;\r\n    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);\r\n  }\r\n  </style>\r\n</head>\r\n\r\n<body>\r\n  <!-- This file lives in public/404.html -->\r\n  <div class=\"dialog\">\r\n    <div>\r\n      <h1>The page you were looking for doesn't exist.</h1>\r\n      <p>You may have mistyped the address or the page may have moved.</p>\r\n    </div>\r\n    <p>If you are the application owner check the logs for more information.</p>\r\n  </div>\r\n</body>\r\n</html>\r\n\r\n```\r\n\r\nI've also tried it with a GET request instead of a POST:\r\n\r\ncurl request in project-tictactoe/scripts/game-create.sh: \r\n```\r\n#!/bin/bash\r\ncurl --include --request GET http://localhost:4741/games/$ID \\\r\n  --header \"Authorization: Token token=$TOKEN\" \\\r\n  --data ''\r\n\r\n  echo\r\n```\r\nerror message on grunt server: \r\n```\r\nStarted GET \"/games/15\" for ::1 at 2017-04-11 19:31:41 -0400\r\nProcessing by GamesController#show as */*\r\n  Parameters: {\"id\"=>\"15\"}\r\n  User Load (12.6ms)  SELECT  \"users\".* FROM \"users\" WHERE \"users\".\"token\" = $1 LIMIT 1  [[\"token\", \"9719e54efe68666e7bb9dcb8e73886a5\"]]\r\n  Game Load (12.4ms)  SELECT  \"games\".* FROM \"games\" WHERE (player_x_id = 15 or player_o_id = 15) AND \"games\".\"id\" = $1 LIMIT 1  [[\"id\", 15]]\r\n[active_model_serializers] Rendered ActiveModel::Serializer::Null with Hash (0.24ms)\r\nCompleted 404 Not Found in 93ms (Views: 20.5ms | ActiveRecord: 55.3ms)\r\n```\r\n\r\ncommand I run in terminal, along with the error message below:\r\n```\r\n$ ID=14 TOKEN=BAhJIiVmODdmMDdjOWM5YWE2MTM0NzRkODNlNmUwMDkyN2U3MwY6BkVG--c5e0c87a931917a82984b92cffa9e1da51ce0570 sh scripts/game-create.sh\r\nHTTP/1.1 404 Not Found\r\nX-Frame-Options: SAMEORIGIN\r\nX-XSS-Protection: 1; mode=block\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nContent-Type: application/json; charset=utf-8\r\nX-Request-Id: f0262387-17ce-469c-825e-b59621a04ed1\r\nX-Runtime: 0.044360\r\nVary: Origin\r\nTransfer-Encoding: chunked\r\n\r\n{\"error\":{\"message\":\"Not Found\"}}~/wdi/projects/project-tictactoe (game-api-create)\r\n$ ID=15 TOKEN=BAhJIiU5NzE5ZTU0ZWZlNjg2NjZlN2JiOWRjYjhlNzM4ODZhNQY6BkVG--41dee1189ccf82dc42516eea6623366857e470f6 sh scripts/game-create.sh\r\nHTTP/1.1 404 Not Found\r\nX-Frame-Options: SAMEORIGIN\r\nX-XSS-Protection: 1; mode=block\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nContent-Type: application/json; charset=utf-8\r\nX-Request-Id: 50ec95d8-e540-471c-ad1a-7312bd986c2d\r\nX-Runtime: 0.107895\r\nVary: Origin\r\nTransfer-Encoding: chunked\r\n\r\n{\"error\":{\"message\":\"Not Found\"}}~/wdi/projects/project-tictactoe (game-api-create)\r\n```"},"comment":{"url":"https://api.github.com/repos/ga-wdi-boston/game-project/issues/comments/293607456","html_url":"https://github.com/ga-wdi-boston/game-project/issues/593#issuecomment-293607456","issue_url":"https://api.github.com/repos/ga-wdi-boston/game-project/issues/593","id":293607456,"user":{"login":"MicFin","id":5384023,"avatar_url":"https://avatars0.githubusercontent.com/u/5384023?v=3","gravatar_id":"","url":"https://api.github.com/users/MicFin","html_url":"https://github.com/MicFin","followers_url":"https://api.github.com/users/MicFin/followers","following_url":"https://api.github.com/users/MicFin/following{/other_user}","gists_url":"https://api.github.com/users/MicFin/gists{/gist_id}","starred_url":"https://api.github.com/users/MicFin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MicFin/subscriptions","organizations_url":"https://api.github.com/users/MicFin/orgs","repos_url":"https://api.github.com/users/MicFin/repos","events_url":"https://api.github.com/users/MicFin/events{/privacy}","received_events_url":"https://api.github.com/users/MicFin/received_events","type":"User","site_admin":false},"created_at":"2017-04-12T15:06:40Z","updated_at":"2017-04-12T15:06:40Z","body":"Review https://github.com/ga-wdi-boston/game-project-api#create\r\n>The create action expects a POST with an empty body (e.g '' or '{}' if JSON). If the request is successful, the response will have an HTTP Status of 201 Created, and the body will contain JSON of the created game with player_x set to the user calling create.\r\n\r\nAnd conceptually, why would a game have an ID if it hasn't been created yet?\r\nThe API says the response will be the game object that contains its ID that was created by the database."}}
{"actor":{"display_login":"MicFin"}}