I need to construct an `HttpStatement` and then in...
# ktor
h
I need to construct an
HttpStatement
and then inspect all the parts (method, headers, and raw body) to create the signing of the request (AWS v4 signing). I thought I could use
preparePost()
like this, but that doesn't give me access to the details. Is there some other way to do this?
Copy code
val statement = httpsClient.preparePost(url) {
    setBody(signedRequest.body)
    headers { 
        contentType(ContentType.Application.Json)
        accept(ContentType.Application.Json)
    }
}
// Read the HTTP request properties from statement not possible?
It would also be nice to be able to call a builder on an existing
HttpStatement
so we can amend it with additional details (like the signed headers we get from AWS).
a
You can use the Send hook to examine the request before sending it. For some request body types, splitting the body channel will be required to avoid its consumption while signing the request.
👍 1