Sending POST Request in Go with a Body
· ☕ 3 min read
Introduction Send a POST request in golang is pretty daunting if you have a post body and you’re coming from a scripting language like JavaScript or Python. Here in Go, schema for JSON needs to be defined beforehand in order to marshal and unmarshal string back and forth to JSON. Simple POST This marshaling/unmarshalling could be an oneliner if your request body is not nested, or is one level deep, or there is not even a body.