title: Golang post return json response
body: <p>I'm trying to make a request to my (magento)webserver using golang.</p>
  
  <p>I managed to make a POST request, but however, I'm not getting the same response I'm getting when using CURL from the cmd.
  I followed this post (<a href="https://stackoverflow.com/questions/17156371/how-to-get-json-response-in-golang">How to get JSON response in Golang</a>) which does not give me any response.</p>
  
  <p>So I tried this</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "net/http"
      "os"
  )
  
  var protocol = "http://"
  var baseURL = protocol + "myserver.dev"
  
  func main() {
  
      fmt.Print("Start API Test on: " + baseURL + "\n")
      r := getCart()
      fmt.Print(r)
  }
  
  func getCart() *http.Response {
      resp, err := http.Post(os.ExpandEnv(baseURL+"/index.php/rest/V1/guest-carts/"), "", nil)
      if err != nil {
          fmt.Print(err)
      }
  
      return resp
  }
  </code></pre>
  
  <p>This just return the http reponse like </p>
  
  <pre><code>{200 OK 200 HTTP/1.1 1 1 map[Date:[Thu, 04 May 2017 05:30:20 GMT] Content-Type:[application/json; charset=utf-8] Set-Cookie:[PHPSESSID=elklkflekrlfekrlklkl; expires=Thu, 04-May-2017 ...
  </code></pre>
  
  <p>When using <code>curl -g -X POST "my.dev/index.php/rest/V1/guest-carts/"</code> I retrieve some kind of ID which I need to proceed.
  How can I get the this curl result in golang?</p>