You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
set GOHOSTARCH=amd64
set GOHOSTOS=windows
What did you do?
I wrote a RESTful API for adding albums according to the documentation(Tutorial: Developing a RESTful API with Go and Gin), but when i called it according to the curl command in the case, an error occurred.
$ 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}'
Finall I found out that I need to escape the double quotes in the data send using curl, otherwise the problem will occur.
The following case can be send successfully.
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}'
What did you expect to see?
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}'
What did you see instead?
$ 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.
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I wrote a RESTful API for adding albums according to the documentation(Tutorial: Developing a RESTful API with Go and Gin), but when i called it according to the curl command in the case, an error occurred.
Finall I found out that I need to escape the double quotes in the data send using curl, otherwise the problem will occur.
The following case can be send successfully.
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: