I am learning Go, and am currently working through this tutorial. When I run the command to test that POST is handled correctly, I get an error message. I cast the body to a string in the course of my debugging, and as best I can tell only part of the json body is being properly included under the data flag. I made the same POST request via Postman, and it worked perfectly. Running the latest version of curl.
Error:
HTTP/1.1 200 OK
Date: Wed, 26 Jul 2023 22:34:49 GMT
Content-Length: 0
curl: (6) Could not resolve host: Modern
curl: (6) Could not resolve host: Sound
curl: (6) Could not resolve host: of
curl: (6) Could not resolve host: Betty
curl: (3) URL using bad/illegal format or missing URL
curl: (3) unmatched close brace/bracket in URL position 20:
Carter,price: 49.99}
^
Curl command:
curl http://localhost:8080/albums --include --header "Content-Type: application/json" --request "POST" --data '{"id": "4","title": "The Modern Sound of Betty Carter","artist": "Betty Carter","price": 49.99}'