export type GetApiOTHERSearchOtherHarByResponseRegexOptions = {baseUrl?: string | undefined, apiKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Returns the HTTP messages, in HAR format, that match the given regular expression in the response optionally filtered by URL and paginated with 'start' position and 'count' of messages. * * GET /OTHER/search/other/harByResponseRegex/ * * Also accepts auth: apiKeyQuery */ export const getApiOTHERSearchOtherHarByResponseRegex = async (options?: GetApiOTHERSearchOtherHarByResponseRegexOptions) => { const {baseUrl = "http://zap", fetch: fetchFn = fetch, apiKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (apiKeyHeader !== undefined) headers.set("X-ZAP-API-Key", apiKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/OTHER/search/other/harByResponseRegex/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };