You're probably having problems with spacing or quotes in the shell. Try saving your JSON in a file, then pass that file name to curl instead of writing the JSON on the command line.
Example assuming your JSON lives in /tmp/ex.json:
curl -XPOST -Hcontent-type:application/json -d@/tmp/ex.json http://localhost:5984/books/_temp_view?group=true