Skip to content

AWS CRT HTTP Client Sample GET Request #3862

Answered by zoewangg
grandamp asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @grandamp, we have some sample code of using AwsCrtAsyncHttpClient as a generic HTTP client in our test code

public void testGetRequest() throws Exception {
String path = "/testGetRequest";
byte[] body = generateRandomBody(TEST_BODY_LEN);
String expectedBodyHash = sha256Hex(body).toUpperCase();
stubFor(any(urlEqualTo(path)).willReturn(aResponse().withStatus(200)
.withHeader("Content-Length", Integer.toString(TEST_BODY_LEN))
.withHeader("foo", "bar")
.withBody(body)));
Compl…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@grandamp
Comment options

Answer selected by zoewangg
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants