HTTP2 OPTION
#558
-
|
Is this expected behavior? It seems that defining a single http2_option overrides some HTTP/2 configurations instead of merging with the defaults. Example 1 — Custom pseudo-header orderfrom wreq import EmulationOption, Emulation, EmulationOS, Http2Options, PseudoOrder, PseudoId
from wreq.blocking import Client
http2_config = Http2Options(
headers_pseudo_order=PseudoOrder(
PseudoId.METHOD,
PseudoId.AUTHORITY,
PseudoId.SCHEME,
PseudoId.PATH,
)
)
client = Client(
emulation=EmulationOption(Emulation.Chrome145, EmulationOS.Windows),
http2_options=http2_config
)
response = client.get(url="https://tls.peet.ws/api/all")
print(response.text())Result"http2": {
"akamai_fingerprint": "4:2097152|5177345|0|m,a,s,p",
"akamai_fingerprint_hash": "5cb381be56d7ac7eb675efe4374a329f",
"sent_frames": [
{
"frame_type": "SETTINGS",
"length": 6,
"settings": [
"INITIAL_WINDOW_SIZE = 2097152"
]
},
{
"frame_type": "WINDOW_UPDATE",
"length": 4,
"increment": 5177345
},
{
"frame_type": "HEADERS",
"stream_id": 1,
"length": 417,
"headers": [
":method: GET",
":authority: tls.peet.ws",
":scheme: https",
":path: /api/all",
"sec-ch-ua: \\\"Chromium\\\";v=\\\"145\\\", \\\"Not;A=Brand\\\";v=\\\"24\\\", \\\"Google Chrome\\\";v=\\\"145\\",
"sec-ch-ua-mobile: ?0",
"sec-ch-ua-platform: \\\"Windows\\",
"user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36",
"sec-fetch-dest: document",
"sec-fetch-mode: navigate",
"sec-fetch-site: none",
"accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"accept-encoding: gzip, deflate, br, zstd",
"accept-language: en-US,en;q=0.9",
"priority: u=0, i"
],
"flags": [
"EndStream (0x1)",
"EndHeaders (0x4)"
]
}
]
}Example 2 — Default configurationfrom wreq import EmulationOption, Emulation, EmulationOS
from wreq.blocking import Client
client = Client(
emulation=EmulationOption(Emulation.Chrome145, EmulationOS.Windows)
)
response = client.get(url="https://tls.peet.ws/api/all")
print(response.text())Result"http2": {
"akamai_fingerprint": "1:65536;2:0;4:6291456;6:262144|15663105|0|m,a,s,p",
"akamai_fingerprint_hash": "52d84b11737d980aef856699f885ca86",
"sent_frames": [
{
"frame_type": "SETTINGS",
"length": 24,
"settings": [
"HEADER_TABLE_SIZE = 65536",
"ENABLE_PUSH = 0",
"INITIAL_WINDOW_SIZE = 6291456",
"MAX_HEADER_LIST_SIZE = 262144"
]
},
{
"frame_type": "WINDOW_UPDATE",
"length": 4,
"increment": 15663105
},
{
"frame_type": "HEADERS",
"stream_id": 1,
"length": 422,
"headers": [
":method: GET",
":authority: tls.peet.ws",
":scheme: https",
":path: /api/all",
"sec-ch-ua: \\\"Chromium\\\";v=\\\"145\\\", \\\"Not;A=Brand\\\";v=\\\"24\\\", \\\"Google Chrome\\\";v=\\\"145\\",
"sec-ch-ua-mobile: ?0",
"sec-ch-ua-platform: \\\"Windows\\",
"user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36",
"sec-fetch-dest: document",
"sec-fetch-mode: navigate",
"sec-fetch-site: none",
"accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"accept-encoding: gzip, deflate, br, zstd",
"accept-language: en-US,en;q=0.9",
"priority: u=0, i"
],
"flags": [
"EndStream (0x1)",
"EndHeaders (0x4)",
"Priority (0x20)"
],
"priority": {
"weight": 220,
"depends_on": 0,
"exclusive": 1
}
}
]
} |
Beta Was this translation helpful? Give feedback.
Answered by
0x676e67
Apr 10, 2026
Replies: 1 comment 1 reply
-
|
Yes, this is expected, because with HTTP2 options, there are dozens of options. Each object is an independent configuration. If one were to combine and compare their attributes, it would be a nightmare. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Pemoca
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, this is expected, because with HTTP2 options, there are dozens of options. Each object is an independent configuration. If one were to combine and compare their attributes, it would be a nightmare.