php - How do I write this cURL request correctly? -


i trying complete facebook messenger bot based on tutorial here: https://github.com/voronianski/simon-le-bottle/blob/master/guide.md

as can see in last instruction, must send page access token via curl request in following format:

curl -i \  -h "content-type: application/json" \  -x post \ -d "{\"verifytoken\": \"your verify token\", \"token\": \"your page access token\"}" \ https://your_generated_url.now.sh/token 

of course replaced "your verify token" token i've generated , "your page access token" page access token i've generated , "your generated url" own url. however, have tried multiple times , gotten various errors.

the first time tried copying , pasting tokens , url input space , pasting curl request in format. received following errors:

curl: (6) not resolve host:   -bash: -h: command not found -bash: -x: command not found 

basically received commands not found. then, tried different approach , removed new line tabs , leaving spaces so

curl -i \ -h "content-type: application/json" \  -x post \ -d "{\"verifytoken\": \"randomverifytokenhere\", \"token\": otherrandomtokenhere\"}" https://myspecificurl.now.sh/token  

where of course had actual working tokens , website yet again. commands seemed work, got whole new crop of errors so:

curl: (6) not resolve host:  -h curl: (6) not resolve host: content-type curl: (6) not resolve host:   curl: (6) not resolve host:  -d curl: (6) not resolve host: "verifytoken" curl: (6) not resolve host:  "token" http/1.1 403 forbidden server: nginx date: wed, 01 jun 2016 21:51:10 gmt content-type: text/plain; charset=utf-8 content-length: 9 connection: keep-alive x-powered-by: express 

if tell me how need format , paste terminal point works, helpful. or if there's easier, better way, appreciate that. every other step, until last instruction, has been completed. website has been verified webhook facebook, , use valid tokens , specific website generated "now". thank everyone, , appreciate help.

make sure have no white space after backslash @ end of lines. when highlight command, there appears space. if remove problem should go away.

if run single line command, remove backslashes @ end of each line.


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo