importhttpfrom"k6/http";import{check}from"k6";exportdefaultfunction(){// Send a JSON encoded POST requestletbody=JSON.stringify({key:"value"});letres=http.post("http://httpbin.org/post",body,{headers:{"Content-Type":"application/json"}});// Use JSON.parse to deserialize the JSON (instead of using the r.json() method)letj=JSON.parse(res.body);// Verify responsecheck(res,{"status is 200":(r)=>r.status===200,"is key correct":(r)=>j.json.key==="value",});}