Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IncomingHttpRequest

Hierarchy

Index

Properties

Optional alias

alias: string

If set, cy.wait can be used to await the request/response cycle to complete for this request via cy.wait('@alias').

Optional body

body: any

Optional followRedirect

followRedirect: boolean

Set if redirects should be followed when this request is made. By default, requests will not follow redirects before yielding the response (the 3xx redirect is yielded)

headers

headers: {}

Type declaration

  • [key: string]: string

Optional httpVersion

httpVersion: string

Optional method

method: Method

Optional responseTimeout

responseTimeout: number

url

url: string

Methods

destroy

  • destroy(): void
  • Destroy the request and respond with a network error.

    Returns void

redirect

  • redirect(location: string, statusCode?: number): void
  • Respond to this request with a redirect to a new location.

    Parameters

    • location: string
    • Optional statusCode: number

      HTTP status code to redirect with. Default: 302

    Returns void

reply

  • Control the response to this request. If a function is passed, the request will be sent outgoing, and the function will be called with the response from the upstream server. If a StaticResponse is passed, it will be used as the response, and no request will be made to the upstream server.

    Parameters

    Returns void

  • Shortcut to reply to the request with a body and optional headers.

    Parameters

    • body: string | object
    • Optional headers: {}
      • [key: string]: string

    Returns void

  • Shortcut to reply to the request with an HTTP status code and optional body and headers.

    Parameters

    • status: number
    • Optional body: string | object
    • Optional headers: {}
      • [key: string]: string

    Returns void

Generated using TypeDoc