Class: Wreq::Emulation

Inherits:
Object
  • Object
show all
Defined in:
lib/wreq_ruby/emulate.rb

Overview

Emulation option wrapper.

This class combines a fingerprint profile, an OS platform, and toggles for HTTP/2 and automatic default headers. The actual implementation is provided by Rust.

profile: defaults to the library's default profile when omitted. platform: defaults to the library's default platform when omitted.

Examples:

Create an emulation option

emu = Wreq::Emulation.new(
  profile: Wreq::Profile::Chrome117,
  platform: Wreq::Platform::Windows,
  http2: true,
  headers: true
)

Class Method Summary collapse

Class Method Details

.new(profile: nil, platform: nil, http2: true, headers: true) ⇒ Object

Parameters:

  • profile (Wreq::Profile, nil) (defaults to: nil)

    Fingerprint profile to emulate

  • platform (Wreq::Platform, nil) (defaults to: nil)

    Operating system platform to emulate

  • http2 (Boolean) (defaults to: true)

    Whether HTTP/2 support is enabled

  • headers (Boolean) (defaults to: true)

    Whether default emulation headers are enabled



228
229
# File 'lib/wreq_ruby/emulate.rb', line 228

def self.new(profile: nil, platform: nil, http2: true, headers: true)
end