Class: Playwright::APIRequest

Inherits:
PlaywrightApi show all
Defined in:
lib/playwright_api/api_request.rb,
sig/playwright.rbs

Overview

Exposes API that can be used for the Web API testing. This class is used for creating APIRequestContext instance which in turn can be used for sending web requests. An instance of this class can be obtained via [property: Playwright.request]. For more information see APIRequestContext.

Instance Method Summary collapse

Methods inherited from PlaywrightApi

#initialize, unwrap, wrap

Constructor Details

This class inherits a constructor from Playwright::PlaywrightApi

Instance Method Details

#new_context(baseURL: nil, clientCertificates: nil, extraHTTPHeaders: nil, failOnStatusCode: nil, httpCredentials: nil, ignoreHTTPSErrors: nil, maxRedirects: nil, proxy: nil, storageState: nil, timeout: nil, userAgent: nil) ⇒ APIRequestContext

Creates new instances of APIRequestContext.

Parameters:

  • baseURL: (String) (defaults to: nil)
  • clientCertificates: (Array[untyped]) (defaults to: nil)
  • extraHTTPHeaders: (Hash[untyped, untyped]) (defaults to: nil)
  • failOnStatusCode: (Boolean) (defaults to: nil)
  • httpCredentials: (Hash[untyped, untyped]) (defaults to: nil)
  • ignoreHTTPSErrors: (Boolean) (defaults to: nil)
  • maxRedirects: (Integer) (defaults to: nil)
  • proxy: (Hash[untyped, untyped]) (defaults to: nil)
  • storageState: ((String | File), Hash[untyped, untyped]) (defaults to: nil)
  • timeout: (Float) (defaults to: nil)
  • userAgent: (String) (defaults to: nil)

Returns:



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/playwright_api/api_request.rb', line 11

def new_context(
      baseURL: nil,
      clientCertificates: nil,
      extraHTTPHeaders: nil,
      failOnStatusCode: nil,
      httpCredentials: nil,
      ignoreHTTPSErrors: nil,
      maxRedirects: nil,
      proxy: nil,
      storageState: nil,
      timeout: nil,
      userAgent: nil)
  wrap_impl(@impl.new_context(baseURL: unwrap_impl(baseURL), clientCertificates: unwrap_impl(clientCertificates), extraHTTPHeaders: unwrap_impl(extraHTTPHeaders), failOnStatusCode: unwrap_impl(failOnStatusCode), httpCredentials: unwrap_impl(httpCredentials), ignoreHTTPSErrors: unwrap_impl(ignoreHTTPSErrors), maxRedirects: unwrap_impl(maxRedirects), proxy: unwrap_impl(proxy), storageState: unwrap_impl(storageState), timeout: unwrap_impl(timeout), userAgent: unwrap_impl(userAgent)))
end