code: func buildRequest(proxyEvent *Event, ctx *apex.Context) (*http.Request, error) {
  	// Reconstruct the request URL
  	u, err := url.Parse(proxyEvent.Path)
  	if err != nil {
  		return nil, fmt.Errorf("Parse request path: %s", err)
  	}
  	q := u.Query()
  	for k, v := range proxyEvent.QueryStringParameters {
  		q.Set(k, v)
  	}
  	u.RawQuery = q.Encode()
  
  	// Decode the request body
  	dec := proxyEvent.Body
  	if proxyEvent.IsBase64Encoded {
  		data, err2 := base64.StdEncoding.DecodeString(dec)
  		if err2 != nil {
  			return nil, fmt.Errorf("Decode base64 request body: %s", err2)
  		}
  		dec = string(data)
  	}
  
  	// Create a new request object
  	req, err := http.NewRequest(proxyEvent.HTTPMethod, u.String(), strings.NewReader(dec))
  	if err != nil {
  		return nil, fmt.Errorf("Create request: %s", err)
  	}
  
  	// Copy event headers to request
  	for k, v := range proxyEvent.Headers {
  		req.Header.Set(k, v)
  	}
  
  	// Store the original event and context in the request headers
  	proxyEvent.Body = "... truncated"
  	hbody, err := json.Marshal(proxyEvent)
  	if err != nil {
  		return nil, fmt.Errorf("Marshal proxy event: %s", err)
  	}
  	req.Header.Set("X-ApiGatewayProxy-Event", string(hbody))
  	if ctx != nil {
  		req.Header.Set("X-ApiGatewayProxy-Context", string(ctx.ClientContext))
  	}
  
  	// Map additional request information
  	req.Host = proxyEvent.Headers["Host"]
  
  	return req, nil
  }
docs: // Constructs an http.Request object from a proxyEvent