Skip to content
On this page

withFollowRedirects

Follows redirection.

Syntax

js
withFollowRedirects(follow)
  • follow (boolean) - follow redirect.

Usage

โœ… Correct Usage

js
await spec()
  .get('/api/old/location')
  .withFollowRedirects()
  .expectStatus(200);

Examples

General Redirection

js
const { spec } = require('pactum');

await spec()
  .get('https://httpbin.org/redirect-to')
  .withQueryParams('url', 'https://httpbin.org/status/200')
  .withFollowRedirects(true)
  .expectStatus(200);

Released under the MIT License.