Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
APIGatewayProxyResponseEvent response = new APIGatewayProxyResponseEvent()
.withHeaders(headers);
try {
final String pageContents = this.getPageContents("https://checkip.amazonaws.com");
String output = String
.format("{ \"message\": \"hello world\", \"location\": \"%s\" }", pageContents);
return response.withStatusCode(200).withBody(output);
} catch (IOException e) {
return response.withBody("{}").withStatusCode(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.