Question

I am new to dashing, followed the instructions found here and just managed to get the "sweet_dashboard_project" up and running successfully.

At the bottom of the dashboard it says:

"Try this: curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "text": "Hey, Look what I can do!" }' \http://localhost:3030/widgets/welcome"

When I try it, the following error occurs:

    curl: (6) Could not resolve host: auth_token
    curl: (6) Could not resolve host: YOUR_AUTH_TOKEN,
    curl: (6) Could not resolve host: text
    curl: (6) Could not resolve host: Hey, Look what I can do!
    curl: (3) [globbing] unmatched close brace/bracket in column 1
    curl: (1) Protocol \http not supported or disabled in libcurl

config.ru looks like this

require 'dashing'

configure do
  set :auth_token, 'YOUR_AUTH_TOKEN'

  helpers do
    def protected!
     # Put any authentication code you want in here.
     # This method is run before accessing any resource.
    end
  end
end

map Sinatra::Application.assets_prefix do
  run Sinatra::Application.sprockets
end

run Sinatra::Application

enter image description here

What am I doing wrong here?

Thanks!

Was it helpful?

Solution 2

This will work, assuming you are using Windows?

curl -X POST  -H "Content-Type: application/json" -d "{ \"auth_token\": \"YOUR_AUTH_TOKEN\", \"text\": \"Hey, Look what I can do!\" }" http://localhost:3030/widgets/welcome

OTHER TIPS

you are using \http which is incorrect.

Also, put double quote around the json(if you use windows). Use header application/json.

curl -d "{ \"auth_token\": \"YOUR_AUTH_TOKEN\", \"text\": \"Hey, Look what I can do!\" }' -H "Content-Type: application/json" http://localhost:3030/widgets/welcome
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top