Expand description
§rquest-util
A collection of utilities to do common things with rquest.
§Emulation
-
Emulation Device
In fact, most device models have the same
TLS
/HTTP2
configuration, except that theUser-Agent
is changed.§Default device emulation types
Browser Versions Chrome Chrome100
,Chrome101
,Chrome104
,Chrome105
,Chrome106
,Chrome107
,Chrome108
,Chrome109
,Chrome110
,Chrome114
,Chrome116
,Chrome117
,Chrome118
,Chrome119
,Chrome120
,Chrome123
,Chrome124
,Chrome126
,Chrome127
,Chrome128
,Chrome129
,Chrome130
,Chrome131
,Chrome132
,Chrome133
,Chrome134
,Chrome135
Edge Edge101
,Edge122
,Edge127
,Edge131
,Edge134
Safari SafariIos17_2
,SafariIos17_4_1
,SafariIos16_5
,Safari15_3
,Safari15_5
,Safari15_6_1
,Safari16
,Safari16_5
,Safari17_0
,Safari17_2_1
,Safari17_4_1
,Safari17_5
,Safari18
,SafariIPad18
,Safari18_2
,Safari18_1_1
,Safari18_3
,Safari18_3_1
OkHttp OkHttp3_9
,OkHttp3_11
,OkHttp3_13
,OkHttp3_14
,OkHttp4_9
,OkHttp4_10
,OkHttp4_12
,OkHttp5
Firefox Firefox109
,Firefox117
,Firefox128
,Firefox133
,Firefox135
,FirefoxPrivate135
,FirefoxAndroid135
,Firefox136
,FirefoxPrivate136
§Example
use rquest::Client;
use rquest_util::Emulation;
#[tokio::main]
async fn main() -> Result<(), rquest::Error> {
// Build a client to emulate Firefox135
let client = Client::builder()
.emulation(Emulation::Firefox135)
.danger_accept_invalid_certs(true)
.build()?;
// Use the API you're already familiar with
let text = client
.get("https://tls.peet.ws/api/all")
.send()
.await?
.text()
.await?;
println!("{}", text);
Ok(())
}
Macros§
- conditional_
http2 - header_
chrome_ accpet - header_
chrome_ sec_ ch_ ua - header_
chrome_ sec_ fetch - header_
chrome_ ua - header_
firefox_ accept - header_
firefox_ sec_ fetch - header_
firefox_ ua - join
Structs§
- Emulation
Option - Represents the configuration options for emulating a browser and operating system.
Enums§
- Emulation
- Represents different browser versions for impersonation.
- EmulationOS
- Represents different operating systems for impersonation.