code: func GetCurlCommand(req *http.Request) (*CurlCommand, error) {
  	command := CurlCommand{}
  
  	command.append("curl")
  
  	command.append("-X", bashEscape(req.Method))
  
  	if req.Body != nil {
  		body, err := ioutil.ReadAll(req.Body)
  		if err != nil {
  			return nil, err
  		}
  		req.Body = nopCloser{bytes.NewBuffer(body)}
  		bodyEscaped := bashEscape(string(body))
  		command.append("-d", bodyEscaped)
  	}
  
  	var keys []string
  
  	for k := range req.Header {
  		keys = append(keys, k)
  	}
  	sort.Strings(keys)
  
  	for _, k := range keys {
  		command.append("-H", bashEscape(fmt.Sprintf("%s: %s", k, strings.Join(req.Header[k], " "))))
  	}
  
  	command.append(bashEscape(req.URL.String()))
  
  	return &command, nil
  }
docs: // GetCurlCommand returns a CurlCommand corresponding to an http.Request