No results for

Powered byAlgolia

del( url, [body], [params] )

suggest edits

Make a DELETE request.

ParameterTypeDescription
urlstringRequest URL (e.g. http://example.com).
body (optional, discouraged)stringobject
params (optional)objectParams object containing additional request parameters.

Returns

TypeDescription
ResponseHTTP Response object.

Example

import http from 'k6/http';
export default function () {
const url = 'https://httpbin.org/delete';
const headers = { 'Content-Type': 'application/json' };
const data = { name: 'Bert' };
let res = http.del(url, JSON.stringify(data), { headers: headers });
console.log(JSON.parse(res.body).json.name);
}