{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-boston/group-project/issues/135","repository_url":"https://api.github.com/repos/ga-wdi-boston/group-project","labels_url":"https://api.github.com/repos/ga-wdi-boston/group-project/issues/135/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-boston/group-project/issues/135/comments","events_url":"https://api.github.com/repos/ga-wdi-boston/group-project/issues/135/events","html_url":"https://github.com/ga-wdi-boston/group-project/issues/135","id":165102040,"number":135,"title":"Unable to POST from client","user":{"login":"shkherad","id":18443759,"avatar_url":"https://avatars.githubusercontent.com/u/18443759?v=3","gravatar_id":"","url":"https://api.github.com/users/shkherad","html_url":"https://github.com/shkherad","followers_url":"https://api.github.com/users/shkherad/followers","following_url":"https://api.github.com/users/shkherad/following{/other_user}","gists_url":"https://api.github.com/users/shkherad/gists{/gist_id}","starred_url":"https://api.github.com/users/shkherad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shkherad/subscriptions","organizations_url":"https://api.github.com/users/shkherad/orgs","repos_url":"https://api.github.com/users/shkherad/repos","events_url":"https://api.github.com/users/shkherad/events{/privacy}","received_events_url":"https://api.github.com/users/shkherad/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-07-12T14:59:04Z","updated_at":"2016-07-12T15:21:56Z","closed_at":"2016-07-12T15:21:55Z","body":"I am unable to POST (for sign-in and sign-up) from the client.\r\n\r\nError: \r\njquery.js:9175 POST https://localhost:3000/sign-in net::ERR_CONNECTION_CLOSED\r\n\r\nIt keepts saying error connection closed and it never hits the server even tho the server is definitely running, and I am able to successfully sign in and sign up via curl requests.\r\n\r\nSuccessful curl requests:\r\n\r\n```\r\n# sign up\r\n\r\ncurl --include --request POST http://localhost:3000/sign-up \\\r\n  --header \"Content-Type: application/json\" \\\r\n  --data '{\r\n    \"credentials\": {\r\n      \"email\": \"shireen@bean.com\",\r\n      \"password\": \"p\",\r\n      \"password_confirmation\": \"p\"\r\n    }\r\n  }'\r\n\r\n#sign in\r\n\r\ncurl --include --request POST http://localhost:3000/sign-in \\\r\n  --header \"Content-Type: application/json\" \\\r\n  --data '{\r\n    \"credentials\": {\r\n      \"email\": \"shireen@bean.com\",\r\n      \"password\": \"p\"\r\n    }\r\n  }'\r\n```\r\n\r\nThe data is in the correct format, I did not touch the users model and controller from the express api template.\r\n\r\nMy client html forms that are being submitted:\r\n\r\n  ```\r\n    <form id='sign-in'>\r\n          <fieldset>\r\n              <legend>Sign In!</legend>\r\n              <input id='sign-in-email' type='text' name='credentials[email]' placeholder='Username'>\r\n              <input id='sign-in-pass'type='password' name='credentials[password]' placeholder='Password'>\r\n              <input type='submit' value='Sign In'>\r\n          </fieldset>\r\n      </form>\r\n\r\n      <form id='sign-up'>\r\n          <fieldset>\r\n            <legend>Sign up!</legend>\r\n            <input id='sign-up-email' type='text' name='credentials[email]' placeholder='Username'>\r\n            <input id='sign-up-pass' type='password' name='credentials[password]' placeholder='Password'>\r\n            <input type='password' name='credentials[password_confirmation]' placeholder='Confirm Password'>\r\n            <input type='submit' value='Sign up!'>\r\n          </fieldset>\r\n        </form>\r\n```\r\n\r\nJS event:\r\n\r\n```\r\nconst onSignUp = function(event) {\r\n  event.preventDefault();\r\n  let data = getFormFields(event.target);\r\n  console.log(data)\r\n  api.signUp(data)\r\n  .done(ui.signUpSuccess)\r\n  .fail(ui.failure);\r\n};\r\n\r\nconst onSignIn = function(event) {\r\n  event.preventDefault();\r\n  let data = getFormFields(event.target);\r\n  console.log(data)\r\n  api.signIn(data)\r\n  .done(ui.signInSuccess)\r\n  .fail(ui.failure);\r\n};\r\n```\r\n\r\nJS api:\r\n\r\n```\r\nconst signUp = (data) => {\r\n  return $.ajax({\r\n    url: app.host + '/sign-up',\r\n    method: \"POST\",\r\n    data: data,\r\n  });\r\n};\r\n\r\nconst signIn = (data) => {\r\n  return $.ajax({\r\n    url: app.host + '/sign-in',\r\n    method: \"POST\",\r\n    data: data,\r\n  });\r\n};\r\n```"},"comment":{"url":"https://api.github.com/repos/ga-wdi-boston/group-project/issues/comments/232082392","html_url":"https://github.com/ga-wdi-boston/group-project/issues/135#issuecomment-232082392","issue_url":"https://api.github.com/repos/ga-wdi-boston/group-project/issues/135","id":232082392,"user":{"login":"shkherad","id":18443759,"avatar_url":"https://avatars.githubusercontent.com/u/18443759?v=3","gravatar_id":"","url":"https://api.github.com/users/shkherad","html_url":"https://github.com/shkherad","followers_url":"https://api.github.com/users/shkherad/followers","following_url":"https://api.github.com/users/shkherad/following{/other_user}","gists_url":"https://api.github.com/users/shkherad/gists{/gist_id}","starred_url":"https://api.github.com/users/shkherad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shkherad/subscriptions","organizations_url":"https://api.github.com/users/shkherad/orgs","repos_url":"https://api.github.com/users/shkherad/repos","events_url":"https://api.github.com/users/shkherad/events{/privacy}","received_events_url":"https://api.github.com/users/shkherad/received_events","type":"User","site_admin":false},"created_at":"2016-07-12T15:21:55Z","updated_at":"2016-07-12T15:21:55Z","body":"SOLVED:\r\n\r\nProtocol changed from https to http. See app.host code below:\r\n\r\n\r\n```\r\n'use strict';\r\n\r\nconst app = {\r\n  host: 'http://localhost:3000',\r\n};\r\n\r\nmodule.exports = app;\r\n\r\n```\r\n\r\nThanks @jrhorn424 !"}}
{"actor":{"display_login":"shkherad"}}