code: func prepareRequestBody(data interface{}) ([]byte, contentType, error) {
  	switch data := data.(type) {
  	case nil:
  		// Nil bodies are accepted by `net/http`, so this is not an error.
  		return nil, contentTypeEmpty, nil
  	case string:
  		return []byte(data), contentTypeFormURLEncoded, nil
  	default:
  		b, err := json.Marshal(data)
  		if err != nil {
  			return nil, contentType(""), err
  		}
  
  		return b, contentTypeJSON, nil
  	}
  }
docs: // prepareRequestBody takes untyped data and attempts constructing a meaningful
  // request body from it. It also returns the appropriate Content-Type.