Skip to content

Latest commit

 

History

History
71 lines (50 loc) · 2.01 KB

File metadata and controls

71 lines (50 loc) · 2.01 KB

Back to overview

Get

The Get class provides a convenient way to perform HTTP GET requests. It allows customization of headers and the format of the response body, offering flexibility in testing scenarios. This class extends the abstract ARequest class.

Table of Contents

Class Overview

Extends

This class extends the ARequest abstract class, providing a specific implementation for sending HTTP GET requests.

Methods

performAs

public async performAs(actor: Actor): Promise<Response>;
  • Description: Send an HTTP GET request to the specified URL.
  • Parameters:
    • actor - The actor performing the action.
  • Returns: Promise<Response> - The response object.

from

public static from(url: string): Get;
  • Description: Create a new instance of the Get class with the specified URL.
  • Parameters:
    • url - The URL of the target.
  • Returns: Get - A new instance of the Get class.

withHeaders

public withHeaders(headers: Headers): Get;
  • Description: Add headers to the HTTP GET request.
  • Parameters:
    • headers - The headers to be added.
  • Returns: Get - The updated instance of the Get class.

withResponseBodyFormat

public withResponseBodyFormat(responseBodyFormat: ResponseBodyFormat): Get;
  • Description: Set the format in which the response body should be returned.
  • Parameters:
    • responseBodyFormat - The desired format of the response body which can be one out of json, text, buffer or none. The default is json.
  • Returns: Get - The updated instance of the Get class.

Back to overview