I am building a body for a POST request
relativeurl := "this-is-a-test-url"
postBody := fmt.Sprintf("{\"requests\": [{\"httpMethod\": \"GET\",\"relativeUrl\": \"%s\"}]}", relativeurl)
When I do a fmt.Println
of postBody
, I see:
{
"requests": [
{
"httpMethod": "GET",
"relativeUrl": "this-is-a-test-url"}]}
but the url is expecting a JSON:
{
"requests": [
{
"httpMethod": "GET",
"relativeUrl": "this-is-a-test-url"
}
]
}
Is the way I build the post body wrong?