The Head
class provides a convenient way to perform HTTP HEAD requests. It allows customization of headers, offering flexibility in testing scenarios where only the headers and not the response body are of interest. This class extends the abstract ARequest
class.
This class extends the ARequest
abstract class, providing a specific implementation for sending HTTP HEAD requests.
public async performAs(actor: Actor): Promise<Response>;
- Description: Send an HTTP HEAD request to the specified URL.
- Parameters:
actor
- The actor performing the action.
- Returns:
Promise<Response>
- The response object.
public static from(url: string): Head;
- Description: Create a new instance of the
Head
class with the specified URL. - Parameters:
url
- The URL of the target.
- Returns:
Head
- A new instance of theHead
class.
public withHeaders(headers: Headers): Head;
- Description: Add headers to the HTTP HEAD request.
- Parameters:
headers
- The headers to be added.
- Returns:
Head
- The updated instance of theHead
class.
public withAbilityAlias(alias: string): Head;
- Description: Defines the ability alias to be used during execution.
- Parameters:
alias
- The alias.
- Returns:
Head
- Returns the current action.
Introduced in: 1.6.0
public get orSkipOnFail(): Head;
- Description: Allows to skip an action on fail.
- Returns:
Head
- Returns the current action.