RequestAsBrowserOptions
Properties
url
Type: string
URL of the target endpoint. Supports both HTTP and HTTPS schemes.
method
Type: string
= ""GET""
HTTP method.
headers
Type: Object<string, string>
Additional HTTP headers to add. It's only recommended to use this option, with headers that are typically added by websites, such as cookies. Overriding default browser headers will remove the masking this function provides.
proxyUrl
Type: string
An HTTP proxy to be passed down to the HTTP request. Supports proxy authentication with Basic Auth.
languageCode
Type: string
= "en"
Two-letter ISO 639 language code.
countryCode
Type: string
= "US"
Two-letter ISO 3166 country code.
useMobileVersion
Type: boolean
If true
, the function uses User-Agent of a mobile browser.
ignoreSslErrors
Type: boolean
= true
If set to true, SSL/TLS certificate errors will be ignored.
useInsecureHttpParser
Type: boolean
= true
Node.js' HTTP parser is stricter than parsers used by web browsers, which prevents scraping of websites whose servers do not comply with HTTP specs,
either by accident or due to some anti-scraping protections, causing e.g. the invalid header value char
error. The useInsecureHttpParser
option
forces the HTTP parser to ignore certain errors which lets you scrape such websites. However, it will also open your application to some security
vulnerabilities, although the risk should be negligible as these vulnerabilities mainly relate to server applications, not clients. Learn more in this
blog post.
abortFunction
Type: AbortFunction
Function accepts response
object as a single parameter and should return true or false. If function returns true request gets aborted. This function
is passed to the @apify/http-request NPM package.
useHttp2
Type: boolean
= false
If set to true, it will additionally accept HTTP2 requests. It will choose either HTTP/1.1 or HTTP/2 depending on the ALPN protocol.