ga-wdi-boston / game-project

Other
7 stars 102 forks source link

Difficulty with API/CURL #835

Closed mak1323 closed 7 years ago

mak1323 commented 7 years ago

So I'm having difficulty with my API and Curl, trying to connect with CURL first but failing.

#!/bin/bash

curl "https://aqueous-atoll-85096.herokuapp.com/" \
  --include \
  --request POST \
  --header "Content-Type: application/json" \
  --data '{
    "credentials":{
      "email": "'"${EMAIL}"'",
      "password": "'"${PASSWORD}"'",
      "password_confirmation": "'"${PASSWORD_CONFIRMATION}"'"
    }
  }'

echo

this is what I'm going with but comes back 404

jordanallain commented 7 years ago

are you trying to sign up?

mak1323 commented 7 years ago

Trying to sign up, initiate, everything. Just trying to get the API confirmed to work so I can move unto AJAX, though to be honest I'm not entirely sure my AJAX is hooked up correctly if my curl isn't working.

jordanallain commented 7 years ago

you aren't providing the correct url for signing up.

Verb    URI Pattern Controller#Action
POST    /sign-up    users#signup
jordanallain commented 7 years ago

which means the URL should be

curl "https://aqueous-atoll-85096.herokuapp.com/sign-up" \

mak1323 commented 7 years ago

Thank you, that made a bit more sense. I wasn't sure if I it automatically created that aspect.