No results for

Powered byAlgolia
⚠️ This is archived documentation for v0.31. Go to the latest version

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

suggest edits
ParameterTypeDescription
urlstringRequest URL (e.g. http://example.com).
body (optional)string / object / ArrayBufferRequest body; objects will be x-www-form-urlencoded.
params (optional)objectParams object containing additional request parameters.

Returns

TypeDescription
ResponseHTTP Response object.

Example

import http from 'k6/http';
const url = 'https://httpbin.test.k6.io/';
export default function () {
let params = { headers: { 'X-MyHeader': 'k6test' } };
let res = http.options(url, null, params);
console.log(res.headers['Allow']);
}