Open FrankBowers24 opened 10 years ago
ahhh this is strange that we didn't run into this through the writing/editing process... but you're totally right, I get the error too
thanks for the suggestions, keep them coming!
The problem is that you have an exclamation mark in the body \"body\":\"node rules!\"
. Bash interprets it as "substitute here the last command that began with the character(s) immediately following the exclamation mark", and grumbles at you that it cannot find an event (command) in your history that began with a single double-quote.
The solution is to escape the exclamation mark, like so: \"body\":\"node rules\!\"}"
Maybe using single quotes (') as external wrapper to the --data JSON part could do the trick. https://ec.haxx.se/cmdline-options.html
Your example curl command from chapter 4 does not work with bash. I finally figured out that the exclamation point was confusing the shell.
$ curl -v -H "Content-Type: application/json" -XPOST --data "{\"username\":\"dickeyxxx\", \"body\":\"node rules!\"}" localhost:3000/api/posts -bash: !\"}": event not found