Class APIRequest.NewContextOptions

  • Enclosing interface:
    APIRequest

    public static class APIRequest.NewContextOptions
    extends Object
    • Field Detail

      • baseURL

        public String baseURL
        Methods like APIRequestContext.get() take the base URL into consideration by using the URL() constructor for building the corresponding URL. Examples:
        • baseURL: http://localhost:3000 and sending request to /bar.html results in http://localhost:3000/bar.html
        • baseURL: http://localhost:3000/foo/ and sending request to ./bar.html results in http://localhost:3000/foo/bar.html
        • baseURL: http://localhost:3000/foo (without trailing slash) and navigating to ./bar.html results in http://localhost:3000/bar.html
      • extraHTTPHeaders

        public Map<String,​String> extraHTTPHeaders
        An object containing additional HTTP headers to be sent with every request. Defaults to none.
      • httpCredentials

        public HttpCredentials httpCredentials
        Credentials for HTTP authentication. If no origin is specified, the username and password are sent to any servers upon unauthorized responses.
      • ignoreHTTPSErrors

        public Boolean ignoreHTTPSErrors
        Whether to ignore HTTPS errors when sending network requests. Defaults to false.
      • proxy

        public Proxy proxy
        Network proxy settings.
      • storageStatePath

        public Path storageStatePath
        Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via BrowserContext.storageState(). Path to the file with saved storage state.
      • timeout

        public Double timeout
        Maximum time in milliseconds to wait for the response. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.
      • userAgent

        public String userAgent
        Specific user agent to use in this context.
    • Constructor Detail

      • NewContextOptions

        public NewContextOptions()