Skip to content

Instantly share code, notes, and snippets.

@ppcano
Last active December 12, 2017 22:26
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 ppcano/f644b03606e88416f75e6498846b02ca to your computer and use it in GitHub Desktop.
Save ppcano/f644b03606e88416f75e6498846b02ca to your computer and use it in GitHub Desktop.
import http from "k6/http"
function logResponse(res) {
console.log('URL', res.url);
console.log(res.body);
for (var key in res.headers) {
console.log(key, res.headers[key]);
}
}
export default function() {
let res;
res = http.get('https://httpbin.org/gzip');
logResponse(res);
console.log('\n\n');
res = http.get('https://httpbin.org/deflate');
logResponse(res);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment