This Pull Request addresses #45, namely ignoring k6's discardResponseBodies and always returning response bodies obtained from jslib-aws HTTP calls.
How
In this PR, we introduce a baseRequestParams member in the AWSClient class, which we add to every request made by children class implementations.
Using the baseRequestParams we set the default responseType for children implementation, allowing us to effectively disregard the http discardResponseBodies option. We can still, locally, override it where necessary, as in S3Client.getObject, for instance.
Demo
The following script:
//...
export default async function () {
// List the buckets the AWS authentication configuration
// gives us access to.
const buckets = await s3.listBuckets()
console.log(JSON.stringify(buckets))
const responseWithBody = http.get('https://httpbin.org/get')
console.log(responseWithBody.body)
}
What
This Pull Request addresses #45, namely ignoring k6's
discardResponseBodies
and always returning response bodies obtained from jslib-aws HTTP calls.How
In this PR, we introduce a
baseRequestParams
member in theAWSClient
class, which we add to every request made by children class implementations.Using the
baseRequestParams
we set the default responseType for children implementation, allowing us to effectively disregard the http discardResponseBodies option. We can still, locally, override it where necessary, as inS3Client.getObject
, for instance.Demo
The following script:
Will display something along the lines of:
References
closes #45