Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 2.16 KB

10-del- url- -body-- -params- -.md

File metadata and controls

36 lines (26 loc) · 2.16 KB
title description excerpt
del( url, [body], [params] )
Issue an HTTP DELETE request.
Issue an HTTP DELETE request.

Make a DELETE request.

Parameter Type Description
url string Request URL (e.g. http://example.com).
body (optional, discouraged) string / object / ArrayBuffer Request body; objects will be x-www-form-urlencoded. This is discouraged, because sending a DELETE request with a body has no defined semantics and may cause some servers to reject it.
params (optional) object Params object containing additional request parameters.

Returns

Type Description
Response HTTP Response object.

Example

import http from 'k6/http';

const url = 'https://httpbin.test.k6.io/delete';

export default function () {
  const params = { headers: { 'X-MyHeader': 'k6test' } };
  http.del(url, null, params);
}