I am looking for a quick tutorial on how to perform requests with Golang that emulate those one would use with curl. I have two APIs that I want to communicate with that both essentially work the same way. One is ElasticSearch, the other is Phillips Hue. I know that both of these have libraries in Go. That's not what I'm after, I'm trying to learn how to do this:
$ curl -XGET 'http://localhost:9200/twitter/tweet/_search' -d '{
"query" : {
"term" : { "user" : "kimchy" }
} }'
With Golang. Everything I can find people seem to be hard coding to
http://url:port/api/_function?something=value?anotherthing=value...
But I already have JSON objects floating around in the software. Is there a way that I can emulate the -d feature of CURL with a JSON string or struct or something similar?