@serenity-js/rest
Version:
Serenity/JS Screenplay Pattern library for interacting with REST and other HTTP-based services, supporting comprehensive API testing and blended testing scenarios
40 lines • 1.94 kB
TypeScript
import type { Answerable, AnswersQuestions, UsesAbilities, WithAnswerableProperties } from '@serenity-js/core';
import { Question } from '@serenity-js/core';
import type { AxiosRequestConfig } from 'axios';
/**
* HTTP Request sent by the [`Actor`](https://serenity-js.org/api/core/class/Actor/)
* using the [interaction](https://serenity-js.org/api/core/class/Interaction/) to [`Send`](https://serenity-js.org/api/rest/class/Send/)
*
* @group Models
*/
export declare abstract class HTTPRequest extends Question<Promise<AxiosRequestConfig>> {
protected readonly resourceUri?: Answerable<string>;
protected readonly data?: Answerable<any>;
protected readonly config?: Answerable<WithAnswerableProperties<AxiosRequestConfig>>;
/**
* @param [resourceUri]
* URL to which the request should be sent
*
* @param [data]
* Request body to be sent as part of the Put, Post or Patch request
*
* @param {Answerable<WithAnswerableProperties<AxiosRequestConfig>>} [config]
* Axios request configuration, which can be used to override the defaults
* provided when the [ability](https://serenity-js.org/api/core/class/Ability/) to [`CallAnApi`](https://serenity-js.org/api/rest/class/CallAnApi/) is instantiated
*/
protected constructor(resourceUri?: Answerable<string>, data?: Answerable<any>, config?: Answerable<WithAnswerableProperties<AxiosRequestConfig>>);
/**
* @inheritDoc
*/
answeredBy(actor: AnswersQuestions & UsesAbilities): Promise<AxiosRequestConfig>;
/**
* Determines the request method based on the name of the request class.
* For example: GetRequest => GET, PostRequest => POST, etc.
*/
private static httpMethodName;
/**
* A human-readable description of the request, such as "a GET request", "an OPTIONS request", etc.
*/
private static requestDescription;
}
//# sourceMappingURL=HTTPRequest.d.ts.map