Skip to content

Instantly share code, notes, and snippets.

@mweagle
Created May 3, 2017 02:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mweagle/708637c449315034045178a8716e8f39 to your computer and use it in GitHub Desktop.
Save mweagle/708637c449315034045178a8716e8f39 to your computer and use it in GitHub Desktop.
mock request
// Create an http.Request object with this data...
spartaResp := newSpartaMockHTTPResponse()
spartaReq := &http.Request{
Method: "POST",
URL: &url.URL{
Scheme: "http",
Path: fmt.Sprintf("/%s", functionName),
},
Proto: "HTTP/1.1",
ProtoMajor: 1,
ProtoMinor: 1,
Body: eventBody,
ContentLength: eventBodySize,
TransferEncoding: make([]string, 0),
Host: "localhost",
}
cgoLambdaHTTPAdapter.lambdaHTTPHandlerInstance.ServeHTTP(spartaResp, spartaReq)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment