api-client/packages/hoppscotch-cli/src/interfaces/request.ts
Akash K 80d7dd046d
feat: support for binary body (#4466)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
2024-11-26 19:48:01 +05:30

47 lines
1.4 KiB
TypeScript

import { AxiosPromise, AxiosRequestConfig } from "axios";
import { HoppRESTRequest } from "@hoppscotch/data";
/**
* Provides definition to object returned by createRequest.
* @property {function} request Axios request promise, executed to get axios
* response promise.
* @property {string} path Path of request within collection file.
* @property {string} name Name of request within collection
* @property {string} testScript Stringified hoppscotch testScript, used while
* running testRunner.
*/
export interface RequestStack {
request: () => AxiosPromise<any>;
path: string;
}
/**
* Provides definition to axios request promise's request parameter.
* @property {boolean} supported - Boolean check for supported or unsupported requests.
*/
export interface RequestConfig extends AxiosRequestConfig {
displayUrl?: string;
}
export interface EffectiveHoppRESTRequest extends HoppRESTRequest {
/**
* The effective final URL.
*
* This contains path, params and environment variables all applied to it
*/
effectiveFinalURL: string;
effectiveFinalDisplayURL?: string;
effectiveFinalHeaders: {
key: string;
value: string;
active: boolean;
description: string;
}[];
effectiveFinalParams: {
key: string;
value: string;
active: boolean;
description: string;
}[];
effectiveFinalBody: FormData | string | File | null;
}