title: Golang API response 400
body: <p>I can't see were is my error every time i try to run it i get nothing when i print some of the key variables i got this :</p>
  
  <p><strong>print longURL</strong> </p>
  
  <blockquote>
    <p><a href="http://www.example.com" rel="nofollow">http://www.example.com</a></p>
  </blockquote>
  
  <p><strong>print &amp;output</strong> </p>
  
  <blockquote>
    <p>&amp;{400 Bad Request 400 HTTP/1.1 1 1 map[X-Frame-Options:[SAMEORIGIN]
    X-Xss-Protection:[1; mode=block] Server:[GSE]
    Alternate-Protocol:[443:quic] Content-Type:[application/json;
    charset=UTF-8] Date:[Thu, 12 Jun 2014 02:10:33 GMT] Expires:[Thu, 12
    Jun 2014 02:10:33 GMT] Cache-Control:[private, max-age=0]
    X-Content-Type-Options:[nosniff]] 0xc2100fe940 -1 [chunked] false
    map[] 0xc2100581a0}</p>
  </blockquote>
  
  <pre><code>// c0de urlShort
  
  
  package main
  
  import (
      "bytes"
      "encoding/json"
      "fmt"
      "io/ioutil"
      "log"
      "net/http"
      "os"
  )
  
  type apiResponse struct {
      Id, Kind, LongURL string
  }
  
  func main() {
  
      longURL := os.Args[len(os.Args)-1]
  
      body := bytes.NewBufferString(fmt.Sprintf(
          `{"longURL":"%s"}`,
          longURL))
  
      request, err := http.NewRequest(
          "POST",
          "https://www.googleapis.com/urlshortener/v1/url",
          body)
  
      request.Header.Add("Content-Type", "application/json")
  
      client := http.Client{}
  
      response, err := client.Do(request)
  
      if err != nil {
          log.Fatal(err)
      }
  
      outputAsBytes, err := ioutil.ReadAll(response.Body)
      response.Body.Close()
  
      var output apiResponse
      err = json.Unmarshal(outputAsBytes, &amp;output)
  
      if err != nil {
          log.Fatal(err)
      }
  
      fmt.Printf("%s", output.Id)
  
  }
  </code></pre>