Skip to content

Instantly share code, notes, and snippets.

@endymion
Created January 5, 2018 20: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 endymion/7dc56dd017339164841121c69657350c to your computer and use it in GitHub Desktop.
Save endymion/7dc56dd017339164841121c69657350c to your computer and use it in GitHub Desktop.
The post body is not available to the Lambda function.
$ curl -v -X POST 'https://8cjjw9ynlb.execute-api.us-east-1.amazonaws.com/Prod' -H 'content-type: application/json' -d '{"callerName": "John"}'
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 52.85.109.19...
* TCP_NODELAY set
* Connected to 8cjjw9ynlb.execute-api.us-east-1.amazonaws.com (52.85.109.19) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
* subject: C=US; ST=Washington; L=Seattle; O=Amazon.com, Inc.; CN=*.execute-api.us-east-1.amazonaws.com
* start date: May 30 00:00:00 2017 GMT
* expire date: Feb 28 23:59:59 2018 GMT
* subjectAltName: host "8cjjw9ynlb.execute-api.us-east-1.amazonaws.com" matched cert's "*.execute-api.us-east-1.amazonaws.com"
* issuer: C=US; O=Symantec Corporation; OU=Symantec Trust Network; CN=Symantec Class 3 Secure Server CA - G4
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fb1d2804400)
> POST /Prod HTTP/2
> Host: 8cjjw9ynlb.execute-api.us-east-1.amazonaws.com
> User-Agent: curl/7.54.0
> Accept: */*
> content-type: application/json
> Content-Length: 22
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
* We are completely uploaded and fine
< HTTP/2 200
< content-type: application/json; charset=utf-8
< content-length: 1397
< date: Fri, 05 Jan 2018 20:01:14 GMT
< x-amzn-requestid: 2f396f5c-f253-11e7-8047-c5ebb5c07565
< x-amzn-remapped-content-length: 1397
< x-amzn-remapped-connection: close
< etag: W/"575-Q2FoXlm21BBHvutr6W0BMDcyIXw"
< x-powered-by: Express
< x-amzn-trace-id: sampled=0;root=1-5a4fd98a-36a8c764e9ebd48ee116c161
< x-amzn-remapped-date: Fri, 05 Jan 2018 20:01:14 GMT
< x-cache: Miss from cloudfront
< via: 1.1 e57f56bdea93212b3eb501c00436086f.cloudfront.net (CloudFront)
< x-amz-cf-id: 2B4IfWKqQySDYx2X9Qj2Xwr9BVbaOcHqqQsUykB23aupA8HzD7IipQ==
<
* Connection #0 to host 8cjjw9ynlb.execute-api.us-east-1.amazonaws.com left intact
{"resource":"/","path":"/","httpMethod":"POST","headers":{"Accept":"*/*","CloudFront-Forwarded-Proto":"https","CloudFront-Is-Desktop-Viewer":"true","CloudFront-Is-Mobile-Viewer":"false","CloudFront-Is-SmartTV-Viewer":"false","CloudFront-Is-Tablet-Viewer":"false","CloudFront-Viewer-Country":"US","content-type":"application/json","Host":"8cjjw9ynlb.execute-api.us-east-1.amazonaws.com","User-Agent":"curl/7.54.0","Via":"2.0 e57f56bdea93212b3eb501c00436086f.cloudfront.net (CloudFront)","X-Amz-Cf-Id":"bk6tpIef_o-TbK_QzdholHD33cTimBrKZgOxsJ1TZcAWMOf_k8pIlw==","X-Amzn-Trace-Id":"Root=1-5a4fd98a-5b42d7e00b4a6eea61377b1b","X-Forwarded-For":"24.145.68.136, 204.246.174.64","X-Forwarded-Port":"443","X-Forwarded-Proto":"https"},"queryStringParameters":null,"pathParameters":null,"stageVariables":null,"requestContext":{"requestTime":"05/Jan/2018:20:01:14 +0000","path":"/Prod","accountId":"420836428571","protocol":"HTTP/1.1","resourceId":"lin0cdtx5g","stage":"Prod","requestTimeEpoch":1515182474659,"requestId":"2f396f5c-f253-11e7-8047-c5ebb5c07565","identity":{"cognitoIdentityPoolId":null,"accountId":null,"cognitoIdentityId":null,"caller":null,"sourceIp":"24.145.68.136","accessKey":null,"cognitoAuthenticationType":null,"cognitoAuthenticationProvider":null,"userArn":null,"userAgent":"curl/7.54.0","user":null},"resourcePath":"/","httpMethod":"POST","apiId":"8cjjw9ynlb"},"isBase64Encoded":false}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment