rnet 3.0.0rc2__cp311-abi3-musllinux_1_2_armv7l.whl → 3.0.0rc3__cp311-abi3-musllinux_1_2_armv7l.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rnet might be problematic. Click here for more details.
- rnet/__init__.pyi +71 -44
- rnet/blocking.py +41 -33
- rnet/cookie.py +1 -1
- rnet/emulation.py +0 -1
- rnet/header.py +34 -125
- rnet/rnet.abi3.so +0 -0
- rnet/tls.py +1 -1
- {rnet-3.0.0rc2.dist-info → rnet-3.0.0rc3.dist-info}/METADATA +4 -3
- rnet-3.0.0rc3.dist-info/RECORD +15 -0
- {rnet-3.0.0rc2.dist-info → rnet-3.0.0rc3.dist-info}/WHEEL +1 -1
- rnet-3.0.0rc2.dist-info/RECORD +0 -15
- {rnet-3.0.0rc2.dist-info → rnet-3.0.0rc3.dist-info}/licenses/LICENSE +0 -0
rnet/__init__.pyi
CHANGED
|
@@ -29,6 +29,7 @@ class ClientParams(TypedDict, closed=True):
|
|
|
29
29
|
headers: NotRequired[Union[Dict[str, str], HeaderMap]]
|
|
30
30
|
orig_headers: NotRequired[Union[List[str], OrigHeaderMap]]
|
|
31
31
|
referer: NotRequired[bool]
|
|
32
|
+
history: NotRequired[bool]
|
|
32
33
|
allow_redirects: NotRequired[bool]
|
|
33
34
|
max_redirects: NotRequired[int]
|
|
34
35
|
cookie_store: NotRequired[bool]
|
|
@@ -506,55 +507,62 @@ class Response:
|
|
|
506
507
|
|
|
507
508
|
url: str
|
|
508
509
|
r"""
|
|
509
|
-
|
|
510
|
+
Get the URL of the response.
|
|
510
511
|
"""
|
|
512
|
+
|
|
511
513
|
status: StatusCode
|
|
512
514
|
r"""
|
|
513
|
-
|
|
515
|
+
Get the status code of the response.
|
|
514
516
|
"""
|
|
517
|
+
|
|
515
518
|
version: Version
|
|
516
519
|
r"""
|
|
517
|
-
|
|
520
|
+
Get the HTTP version of the response.
|
|
518
521
|
"""
|
|
522
|
+
|
|
519
523
|
headers: HeaderMap
|
|
520
524
|
r"""
|
|
521
|
-
|
|
525
|
+
Get the headers of the response.
|
|
522
526
|
"""
|
|
527
|
+
|
|
523
528
|
cookies: List[Cookie]
|
|
524
529
|
r"""
|
|
525
|
-
|
|
530
|
+
Get the cookies of the response.
|
|
526
531
|
"""
|
|
532
|
+
|
|
527
533
|
content_length: int
|
|
528
534
|
r"""
|
|
529
|
-
|
|
535
|
+
Get the content length of the response.
|
|
530
536
|
"""
|
|
537
|
+
|
|
531
538
|
remote_addr: Optional[SocketAddr]
|
|
532
539
|
r"""
|
|
533
|
-
|
|
540
|
+
Get the remote address of the response.
|
|
534
541
|
"""
|
|
542
|
+
|
|
535
543
|
local_addr: Optional[SocketAddr]
|
|
536
544
|
r"""
|
|
537
|
-
|
|
545
|
+
Get the local address of the response.
|
|
546
|
+
"""
|
|
547
|
+
|
|
548
|
+
history: List[History]
|
|
549
|
+
r"""
|
|
550
|
+
Get the redirect history of the Response.
|
|
538
551
|
"""
|
|
539
|
-
|
|
552
|
+
|
|
553
|
+
peer_certificate: Optional[bytes]
|
|
540
554
|
r"""
|
|
541
|
-
|
|
555
|
+
Get the DER encoded leaf certificate of the response.
|
|
542
556
|
"""
|
|
543
|
-
def __aenter__(self) -> Any: ...
|
|
544
|
-
def __aexit__(self, _exc_type: Any, _exc_value: Any, _traceback: Any) -> Any: ...
|
|
545
|
-
def peer_certificate(self) -> Optional[bytes]:
|
|
546
|
-
r"""
|
|
547
|
-
Returns the TLS peer certificate of the response.
|
|
548
|
-
"""
|
|
549
557
|
|
|
550
558
|
async def text(self) -> str:
|
|
551
559
|
r"""
|
|
552
|
-
|
|
560
|
+
Get the text content of the response.
|
|
553
561
|
"""
|
|
554
562
|
|
|
555
563
|
async def text_with_charset(self, encoding: str) -> str:
|
|
556
564
|
r"""
|
|
557
|
-
|
|
565
|
+
Get the text content of the response with a specific charset.
|
|
558
566
|
|
|
559
567
|
# Arguments
|
|
560
568
|
|
|
@@ -563,24 +571,48 @@ class Response:
|
|
|
563
571
|
|
|
564
572
|
async def json(self) -> Any:
|
|
565
573
|
r"""
|
|
566
|
-
|
|
574
|
+
Get the JSON content of the response.
|
|
567
575
|
"""
|
|
568
576
|
|
|
569
577
|
async def bytes(self) -> bytes:
|
|
570
578
|
r"""
|
|
571
|
-
|
|
579
|
+
Get the bytes content of the response.
|
|
572
580
|
"""
|
|
573
581
|
|
|
574
582
|
def stream(self) -> Streamer:
|
|
575
583
|
r"""
|
|
576
|
-
|
|
584
|
+
Get the response into a `Stream` of `Bytes` from the body.
|
|
577
585
|
"""
|
|
578
586
|
|
|
579
587
|
async def close(self) -> None:
|
|
580
588
|
r"""
|
|
581
|
-
|
|
589
|
+
Close the response connection.
|
|
582
590
|
"""
|
|
583
591
|
|
|
592
|
+
async def __aenter__(self) -> Any: ...
|
|
593
|
+
async def __aexit__(
|
|
594
|
+
self, _exc_type: Any, _exc_value: Any, _traceback: Any
|
|
595
|
+
) -> Any: ...
|
|
596
|
+
|
|
597
|
+
class History:
|
|
598
|
+
"""
|
|
599
|
+
An entry in the redirect history.
|
|
600
|
+
"""
|
|
601
|
+
|
|
602
|
+
status: int
|
|
603
|
+
"""Get the status code of the redirect response."""
|
|
604
|
+
|
|
605
|
+
url: str
|
|
606
|
+
"""Get the URL of the redirect response."""
|
|
607
|
+
|
|
608
|
+
previous: str
|
|
609
|
+
"""Get the previous URL before the redirect response."""
|
|
610
|
+
|
|
611
|
+
headers: HeaderMap
|
|
612
|
+
"""Get the headers of the redirect response."""
|
|
613
|
+
|
|
614
|
+
def __str__(self) -> str: ...
|
|
615
|
+
|
|
584
616
|
class SocketAddr:
|
|
585
617
|
r"""
|
|
586
618
|
A IP socket address.
|
|
@@ -650,14 +682,6 @@ class Streamer:
|
|
|
650
682
|
|
|
651
683
|
async def main():
|
|
652
684
|
resp = await rnet.get("https://httpbin.org/stream/20")
|
|
653
|
-
print("Status Code: ", resp.status)
|
|
654
|
-
print("Version: ", resp.version)
|
|
655
|
-
print("Response URL: ", resp.url)
|
|
656
|
-
print("Headers: ", resp.headers)
|
|
657
|
-
print("Content-Length: ", resp.content_length)
|
|
658
|
-
print("Encoding: ", resp.encoding)
|
|
659
|
-
print("Remote Address: ", resp.remote_addr)
|
|
660
|
-
|
|
661
685
|
async with resp.stream() as streamer:
|
|
662
686
|
async for chunk in streamer:
|
|
663
687
|
print("Chunk: ", chunk)
|
|
@@ -668,12 +692,14 @@ class Streamer:
|
|
|
668
692
|
```
|
|
669
693
|
"""
|
|
670
694
|
|
|
671
|
-
def __aiter__(self) -> Streamer: ...
|
|
672
|
-
def __anext__(self) ->
|
|
673
|
-
def __aenter__(self) -> Any: ...
|
|
674
|
-
def __aexit__(
|
|
695
|
+
async def __aiter__(self) -> Streamer: ...
|
|
696
|
+
async def __anext__(self) -> Optional[bytes]: ...
|
|
697
|
+
async def __aenter__(self) -> Any: ...
|
|
698
|
+
async def __aexit__(
|
|
699
|
+
self, _exc_type: Any, _exc_value: Any, _traceback: Any
|
|
700
|
+
) -> Any: ...
|
|
675
701
|
def __iter__(self) -> Streamer: ...
|
|
676
|
-
def __next__(self) ->
|
|
702
|
+
def __next__(self) -> bytes: ...
|
|
677
703
|
def __enter__(self) -> Streamer: ...
|
|
678
704
|
def __exit__(self, _exc_type: Any, _exc_value: Any, _traceback: Any) -> None: ...
|
|
679
705
|
|
|
@@ -1097,33 +1123,34 @@ class WebSocket:
|
|
|
1097
1123
|
|
|
1098
1124
|
status: StatusCode
|
|
1099
1125
|
r"""
|
|
1100
|
-
|
|
1126
|
+
Get the status code of the response.
|
|
1101
1127
|
"""
|
|
1102
1128
|
version: Version
|
|
1103
1129
|
r"""
|
|
1104
|
-
|
|
1130
|
+
Get the HTTP version of the response.
|
|
1105
1131
|
"""
|
|
1106
1132
|
headers: HeaderMap
|
|
1107
1133
|
r"""
|
|
1108
|
-
|
|
1134
|
+
Get the headers of the response.
|
|
1109
1135
|
"""
|
|
1110
1136
|
cookies: List[Cookie]
|
|
1111
1137
|
r"""
|
|
1112
|
-
|
|
1138
|
+
Get the cookies of the response.
|
|
1113
1139
|
"""
|
|
1114
1140
|
remote_addr: Optional[SocketAddr]
|
|
1115
1141
|
r"""
|
|
1116
|
-
|
|
1142
|
+
Get the remote address of the response.
|
|
1117
1143
|
"""
|
|
1118
1144
|
protocol: Optional[str]
|
|
1119
1145
|
r"""
|
|
1120
|
-
|
|
1146
|
+
Get the WebSocket protocol.
|
|
1121
1147
|
"""
|
|
1122
|
-
|
|
1123
|
-
def __anext__(self) -> Any: ...
|
|
1148
|
+
|
|
1124
1149
|
def __aenter__(self) -> Any: ...
|
|
1125
1150
|
def __aexit__(self, _exc_type: Any, _exc_value: Any, _traceback: Any) -> Any: ...
|
|
1126
|
-
async def recv(
|
|
1151
|
+
async def recv(
|
|
1152
|
+
self, timeout: datetime.timedelta | None = None
|
|
1153
|
+
) -> Optional[Message]:
|
|
1127
1154
|
r"""
|
|
1128
1155
|
Receives a message from the WebSocket.
|
|
1129
1156
|
"""
|
rnet/blocking.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
from rnet import ClientParams, Message, Request, Streamer, WebSocketRequest
|
|
1
|
+
import datetime
|
|
2
|
+
from rnet import ClientParams, History, Message, Request, Streamer, WebSocketRequest
|
|
3
3
|
from typing import (
|
|
4
4
|
Optional,
|
|
5
5
|
Any,
|
|
@@ -327,56 +327,62 @@ class Response:
|
|
|
327
327
|
|
|
328
328
|
url: str
|
|
329
329
|
r"""
|
|
330
|
-
|
|
330
|
+
Get the URL of the response.
|
|
331
331
|
"""
|
|
332
|
+
|
|
332
333
|
status: StatusCode
|
|
333
334
|
r"""
|
|
334
|
-
|
|
335
|
+
Get the status code of the response.
|
|
335
336
|
"""
|
|
337
|
+
|
|
336
338
|
version: Version
|
|
337
339
|
r"""
|
|
338
|
-
|
|
340
|
+
Get the HTTP version of the response.
|
|
339
341
|
"""
|
|
342
|
+
|
|
340
343
|
headers: HeaderMap
|
|
341
344
|
r"""
|
|
342
|
-
|
|
345
|
+
Get the headers of the response.
|
|
343
346
|
"""
|
|
347
|
+
|
|
344
348
|
cookies: List[Cookie]
|
|
345
349
|
r"""
|
|
346
|
-
|
|
350
|
+
Get the cookies of the response.
|
|
347
351
|
"""
|
|
352
|
+
|
|
348
353
|
content_length: int
|
|
349
354
|
r"""
|
|
350
|
-
|
|
355
|
+
Get the content length of the response.
|
|
351
356
|
"""
|
|
357
|
+
|
|
352
358
|
remote_addr: Optional[SocketAddr]
|
|
353
359
|
r"""
|
|
354
|
-
|
|
360
|
+
Get the remote address of the response.
|
|
355
361
|
"""
|
|
362
|
+
|
|
356
363
|
local_addr: Optional[SocketAddr]
|
|
357
364
|
r"""
|
|
358
|
-
|
|
365
|
+
Get the local address of the response.
|
|
359
366
|
"""
|
|
360
|
-
|
|
367
|
+
|
|
368
|
+
history: List[History]
|
|
361
369
|
r"""
|
|
362
|
-
|
|
370
|
+
Get the redirect history of the Response.
|
|
363
371
|
"""
|
|
364
372
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
Returns the TLS peer certificate of the response.
|
|
370
|
-
"""
|
|
373
|
+
peer_certificate: Optional[bytes]
|
|
374
|
+
r"""
|
|
375
|
+
Get the DER encoded leaf certificate of the response.
|
|
376
|
+
"""
|
|
371
377
|
|
|
372
378
|
def text(self) -> str:
|
|
373
379
|
r"""
|
|
374
|
-
|
|
380
|
+
Get the text content of the response.
|
|
375
381
|
"""
|
|
376
382
|
|
|
377
383
|
def text_with_charset(self, encoding: str) -> str:
|
|
378
384
|
r"""
|
|
379
|
-
|
|
385
|
+
Get the text content of the response with a specific charset.
|
|
380
386
|
|
|
381
387
|
# Arguments
|
|
382
388
|
|
|
@@ -385,24 +391,27 @@ class Response:
|
|
|
385
391
|
|
|
386
392
|
def json(self) -> Any:
|
|
387
393
|
r"""
|
|
388
|
-
|
|
394
|
+
Get the JSON content of the response.
|
|
389
395
|
"""
|
|
390
396
|
|
|
391
397
|
def bytes(self) -> bytes:
|
|
392
398
|
r"""
|
|
393
|
-
|
|
399
|
+
Get the bytes content of the response.
|
|
394
400
|
"""
|
|
395
401
|
|
|
396
402
|
def stream(self) -> Streamer:
|
|
397
403
|
r"""
|
|
398
|
-
|
|
404
|
+
Get the response into a `Stream` of `Bytes` from the body.
|
|
399
405
|
"""
|
|
400
406
|
|
|
401
407
|
def close(self) -> None:
|
|
402
408
|
r"""
|
|
403
|
-
|
|
409
|
+
Close the response connection.
|
|
404
410
|
"""
|
|
405
411
|
|
|
412
|
+
def __enter__(self) -> "Response": ...
|
|
413
|
+
def __exit__(self, _exc_type: Any, _exc_value: Any, _traceback: Any) -> None: ...
|
|
414
|
+
|
|
406
415
|
|
|
407
416
|
class WebSocket:
|
|
408
417
|
r"""
|
|
@@ -411,34 +420,33 @@ class WebSocket:
|
|
|
411
420
|
|
|
412
421
|
status: StatusCode
|
|
413
422
|
r"""
|
|
414
|
-
|
|
423
|
+
Get the status code of the response.
|
|
415
424
|
"""
|
|
416
425
|
version: Version
|
|
417
426
|
r"""
|
|
418
|
-
|
|
427
|
+
Get the HTTP version of the response.
|
|
419
428
|
"""
|
|
420
429
|
headers: HeaderMap
|
|
421
430
|
r"""
|
|
422
|
-
|
|
431
|
+
Get the headers of the response.
|
|
423
432
|
"""
|
|
424
433
|
cookies: List[Cookie]
|
|
425
434
|
r"""
|
|
426
|
-
|
|
435
|
+
Get the cookies of the response.
|
|
427
436
|
"""
|
|
428
437
|
remote_addr: Optional[SocketAddr]
|
|
429
438
|
r"""
|
|
430
|
-
|
|
439
|
+
Get the remote address of the response.
|
|
431
440
|
"""
|
|
432
441
|
protocol: Optional[str]
|
|
433
442
|
r"""
|
|
434
|
-
|
|
443
|
+
Get the WebSocket protocol.
|
|
435
444
|
"""
|
|
436
445
|
|
|
437
|
-
def __iter__(self) -> "WebSocket": ...
|
|
438
|
-
def __next__(self) -> Message: ...
|
|
439
446
|
def __enter__(self) -> "WebSocket": ...
|
|
440
447
|
def __exit__(self, _exc_type: Any, _exc_value: Any, _traceback: Any) -> None: ...
|
|
441
|
-
|
|
448
|
+
|
|
449
|
+
def recv(self, timeout: datetime.timedelta | None = None) -> Optional[Message]:
|
|
442
450
|
r"""
|
|
443
451
|
Receives a message from the WebSocket.
|
|
444
452
|
"""
|
rnet/cookie.py
CHANGED
rnet/emulation.py
CHANGED
rnet/header.py
CHANGED
|
@@ -11,7 +11,7 @@ including proper support for headers that can have multiple values (like
|
|
|
11
11
|
Set-Cookie, Accept-Encoding, etc.).
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
|
-
from typing import List, Optional, Tuple
|
|
14
|
+
from typing import Iterator, List, Optional, Tuple
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class HeaderMap:
|
|
@@ -47,8 +47,8 @@ class HeaderMap:
|
|
|
47
47
|
"""Return the total number of header values (not unique names)."""
|
|
48
48
|
...
|
|
49
49
|
|
|
50
|
-
def __iter__(self) ->
|
|
51
|
-
"""Iterate
|
|
50
|
+
def __iter__(self) -> Iterator[Tuple[bytes, bytes]]:
|
|
51
|
+
"""Iterate all header(name, value) pairs, including duplicates for multiple values."""
|
|
52
52
|
...
|
|
53
53
|
|
|
54
54
|
def __str__(self) -> str:
|
|
@@ -150,7 +150,7 @@ class HeaderMap:
|
|
|
150
150
|
The first header value as bytes, or the default value
|
|
151
151
|
"""
|
|
152
152
|
|
|
153
|
-
def get_all(self, key: str) ->
|
|
153
|
+
def get_all(self, key: str) -> Iterator[bytes]:
|
|
154
154
|
r"""
|
|
155
155
|
Get all values for a header name.
|
|
156
156
|
|
|
@@ -165,6 +165,22 @@ class HeaderMap:
|
|
|
165
165
|
An iterator over all header values
|
|
166
166
|
"""
|
|
167
167
|
|
|
168
|
+
def values(self) -> Iterator[bytes]:
|
|
169
|
+
"""
|
|
170
|
+
Iterate over all header values.
|
|
171
|
+
|
|
172
|
+
Returns:
|
|
173
|
+
An iterator over all header values as bytes.
|
|
174
|
+
"""
|
|
175
|
+
|
|
176
|
+
def keys(self) -> Iterator[bytes]:
|
|
177
|
+
"""
|
|
178
|
+
Iterate over unique header names.
|
|
179
|
+
|
|
180
|
+
Returns:
|
|
181
|
+
An iterator over unique header names as bytes.
|
|
182
|
+
"""
|
|
183
|
+
|
|
168
184
|
def len(self) -> int:
|
|
169
185
|
"""
|
|
170
186
|
Get the total number of header values.
|
|
@@ -204,18 +220,6 @@ class HeaderMap:
|
|
|
204
220
|
is_empty() will return True.
|
|
205
221
|
"""
|
|
206
222
|
|
|
207
|
-
def items(self) -> "HeaderMapItemsIter":
|
|
208
|
-
r"""
|
|
209
|
-
Get an iterator over all header name-value pairs.
|
|
210
|
-
|
|
211
|
-
Returns an iterator that yields tuples of (name, value) for each
|
|
212
|
-
header value. Headers with multiple values will appear multiple
|
|
213
|
-
times with different values.
|
|
214
|
-
|
|
215
|
-
Returns:
|
|
216
|
-
Iterator over (name, value) tuples
|
|
217
|
-
"""
|
|
218
|
-
|
|
219
223
|
|
|
220
224
|
class OrigHeaderMap:
|
|
221
225
|
"""
|
|
@@ -259,33 +263,7 @@ class OrigHeaderMap:
|
|
|
259
263
|
"""
|
|
260
264
|
...
|
|
261
265
|
|
|
262
|
-
def
|
|
263
|
-
"""
|
|
264
|
-
Insert a new header name into the collection.
|
|
265
|
-
|
|
266
|
-
If the map did not previously have this key present, then False is returned.
|
|
267
|
-
If the map did have this key present, the new value is pushed to the end
|
|
268
|
-
of the list of values currently associated with the key. The key is not
|
|
269
|
-
updated, though; this matters for types that can be == without being identical.
|
|
270
|
-
|
|
271
|
-
Args:
|
|
272
|
-
value: The header name to insert.
|
|
273
|
-
|
|
274
|
-
Returns:
|
|
275
|
-
True if the key was newly inserted, False if it already existed.
|
|
276
|
-
"""
|
|
277
|
-
...
|
|
278
|
-
|
|
279
|
-
def extend(self, other: "OrigHeaderMap") -> None:
|
|
280
|
-
"""
|
|
281
|
-
Extends the map with all entries from another OrigHeaderMap, preserving order.
|
|
282
|
-
|
|
283
|
-
Args:
|
|
284
|
-
other: Another OrigHeaderMap to extend from.
|
|
285
|
-
"""
|
|
286
|
-
...
|
|
287
|
-
|
|
288
|
-
def items(self) -> "OrigHeaderMapIter":
|
|
266
|
+
def __iter__(self) -> Iterator[Tuple[bytes, bytes]]:
|
|
289
267
|
"""
|
|
290
268
|
Returns an iterator over the (standard_name, original_name) pairs.
|
|
291
269
|
|
|
@@ -300,97 +278,28 @@ class OrigHeaderMap:
|
|
|
300
278
|
"""
|
|
301
279
|
...
|
|
302
280
|
|
|
303
|
-
|
|
304
|
-
class HeaderMapItemsIter:
|
|
305
|
-
r"""
|
|
306
|
-
Iterator over header name-value pairs in a HeaderMap.
|
|
307
|
-
|
|
308
|
-
Yields tuples of (header_name, header_value) where both are bytes.
|
|
309
|
-
Headers with multiple values will appear as separate tuples.
|
|
310
|
-
"""
|
|
311
|
-
|
|
312
|
-
def __iter__(self) -> "HeaderMapItemsIter":
|
|
313
|
-
"""Return self as iterator."""
|
|
314
|
-
...
|
|
315
|
-
|
|
316
|
-
def __next__(self) -> Optional[Tuple[bytes, bytes]]:
|
|
317
|
-
"""
|
|
318
|
-
Get the next header name-value pair.
|
|
319
|
-
|
|
320
|
-
Returns:
|
|
321
|
-
Tuple of (header_name, header_value) or None when exhausted
|
|
322
|
-
"""
|
|
323
|
-
...
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
class HeaderMapKeysIter:
|
|
327
|
-
r"""
|
|
328
|
-
Iterator over unique header names in a HeaderMap.
|
|
329
|
-
|
|
330
|
-
Yields each unique header name as bytes, regardless of how many
|
|
331
|
-
values each header has.
|
|
332
|
-
"""
|
|
333
|
-
|
|
334
|
-
def __iter__(self) -> "HeaderMapKeysIter":
|
|
335
|
-
"""Return self as iterator."""
|
|
336
|
-
...
|
|
337
|
-
|
|
338
|
-
def __next__(self) -> Optional[bytes]:
|
|
339
|
-
"""
|
|
340
|
-
Get the next unique header name.
|
|
341
|
-
|
|
342
|
-
Returns:
|
|
343
|
-
Header name as bytes, or None when exhausted
|
|
281
|
+
def insert(self, value: str) -> bool:
|
|
344
282
|
"""
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
class HeaderMapValuesIter:
|
|
349
|
-
r"""
|
|
350
|
-
Iterator over header values in a HeaderMap.
|
|
351
|
-
|
|
352
|
-
Yields header values as bytes. When used with get_all(), yields
|
|
353
|
-
all values for a specific header name. When used independently,
|
|
354
|
-
yields all values in the entire map.
|
|
355
|
-
"""
|
|
283
|
+
Insert a new header name into the collection.
|
|
356
284
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
285
|
+
If the map did not previously have this key present, then False is returned.
|
|
286
|
+
If the map did have this key present, the new value is pushed to the end
|
|
287
|
+
of the list of values currently associated with the key. The key is not
|
|
288
|
+
updated, though; this matters for types that can be == without being identical.
|
|
360
289
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
Get the next header value.
|
|
290
|
+
Args:
|
|
291
|
+
value: The header name to insert.
|
|
364
292
|
|
|
365
293
|
Returns:
|
|
366
|
-
|
|
367
|
-
"""
|
|
368
|
-
...
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
class OrigHeaderMapIter:
|
|
372
|
-
"""
|
|
373
|
-
An iterator over the items in an OrigHeaderMap.
|
|
374
|
-
|
|
375
|
-
Yields tuples of (standard_header_name, original_header_name) where:
|
|
376
|
-
- standard_header_name is the normalized header name
|
|
377
|
-
- original_header_name is the header name as originally received/specified
|
|
378
|
-
"""
|
|
379
|
-
|
|
380
|
-
def __iter__(self) -> "OrigHeaderMapIter":
|
|
381
|
-
"""
|
|
382
|
-
Returns the iterator itself.
|
|
294
|
+
True if the key was newly inserted, False if it already existed.
|
|
383
295
|
"""
|
|
384
296
|
...
|
|
385
297
|
|
|
386
|
-
def
|
|
298
|
+
def extend(self, other: "OrigHeaderMap") -> None:
|
|
387
299
|
"""
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
Returns:
|
|
391
|
-
A tuple of (standard_header_name, original_header_name) as bytes.
|
|
300
|
+
Extends the map with all entries from another OrigHeaderMap, preserving order.
|
|
392
301
|
|
|
393
|
-
|
|
394
|
-
|
|
302
|
+
Args:
|
|
303
|
+
other: Another OrigHeaderMap to extend from.
|
|
395
304
|
"""
|
|
396
305
|
...
|
rnet/rnet.abi3.so
CHANGED
|
Binary file
|
rnet/tls.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rnet
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.0rc3
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
@@ -60,7 +60,7 @@ A blazing-fast Python HTTP client with advanced browser fingerprinting that accu
|
|
|
60
60
|
This asynchronous example demonstrates how to make a simple GET request using the `rnet` library. So you need install `rnet` and run the following code:
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
|
-
pip install asyncio rnet==3.0.
|
|
63
|
+
pip install asyncio rnet==3.0.0rc3
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
And then the code:
|
|
@@ -91,7 +91,8 @@ Additional learning resources include:
|
|
|
91
91
|
- [DeepWiki](https://deepwiki.com/0x676e67/rnet)
|
|
92
92
|
- [API Documentation](https://github.com/0x676e67/rnet/blob/main/python/rnet)
|
|
93
93
|
- [Repository Tests](https://github.com/0x676e67/rnet/tree/main/tests)
|
|
94
|
-
- [
|
|
94
|
+
- [Synchronous Examples](https://github.com/0x676e67/rnet/tree/main/python/examples/blocking)
|
|
95
|
+
- [Asynchronous Examples](https://github.com/0x676e67/rnet/tree/main/python/examples)
|
|
95
96
|
|
|
96
97
|
## Platforms
|
|
97
98
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
rnet-3.0.0rc3.dist-info/METADATA,sha256=fEfWy3HHnm5piQjMxfjS8tn9XKDwVisWOB3Q9mWNRUU,10143
|
|
2
|
+
rnet-3.0.0rc3.dist-info/WHEEL,sha256=-AnzwsCZZZo6t7GpinHDciORdL-RbdNP8PxgnJN40TU,106
|
|
3
|
+
rnet-3.0.0rc3.dist-info/licenses/LICENSE,sha256=ryRV02Zq6zAIr1heqDUkcGlpP7gVCDF6AqR4wRa82kI,35153
|
|
4
|
+
rnet.libs/libgcc_s-9d4368bd.so.1,sha256=B7rWHj4RWVk9_1dl-zWKMFMZC-7BdnbvpIyAWLNQDKw,2757253
|
|
5
|
+
rnet/__init__.py,sha256=gqet5qGPHqS1VRr8XjzpQOuYetNn-aLss4lTR7cZ_9M,317
|
|
6
|
+
rnet/__init__.pyi,sha256=udvT5QwB905aczie87n-9BAMePfnzU_yen90CtO-F38,29301
|
|
7
|
+
rnet/blocking.py,sha256=4o6eTsoP0_XboU9JwkVKwPwbo-BtzymmqJnOVRoSdt4,11325
|
|
8
|
+
rnet/cookie.py,sha256=RmkrJ4NXkxapBaa-zP7zJZm-H0TRbYCyAQFtrkvEJAA,2877
|
|
9
|
+
rnet/emulation.py,sha256=JBN1WqW7TrrzRFBxxm6aYYuDfGUfFV8fbWaUiTIBIFA,4993
|
|
10
|
+
rnet/exceptions.py,sha256=pr8RNPhr_CswkdKgZGvamSFwyrHE6OPQk72YcJACNBo,5906
|
|
11
|
+
rnet/header.py,sha256=70Ro2nLV0QJgYARpatFcKJhx3NvxrYpdv6T9WMAu82E,9559
|
|
12
|
+
rnet/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
+
rnet/rnet.abi3.so,sha256=cRM-nXewwNKAIaYt98gmTkaOnukOsDVyHkSLghM39Vo,7565681
|
|
14
|
+
rnet/tls.py,sha256=lbte5JDU9_mcPY62H3zV5aC5sPc9v4vRSf9tMrucROA,4793
|
|
15
|
+
rnet-3.0.0rc3.dist-info/RECORD,,
|
rnet-3.0.0rc2.dist-info/RECORD
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
rnet-3.0.0rc2.dist-info/METADATA,sha256=sYMR4YlcAy5Frl9GSKxIIuPDcnTBZty-D1l8OfnxDRc,10047
|
|
2
|
-
rnet-3.0.0rc2.dist-info/WHEEL,sha256=K1YBP_cIJF7vsuvXanZfv6tGsrXgC9F9BJiLWbx2lN4,106
|
|
3
|
-
rnet-3.0.0rc2.dist-info/licenses/LICENSE,sha256=ryRV02Zq6zAIr1heqDUkcGlpP7gVCDF6AqR4wRa82kI,35153
|
|
4
|
-
rnet.libs/libgcc_s-9d4368bd.so.1,sha256=B7rWHj4RWVk9_1dl-zWKMFMZC-7BdnbvpIyAWLNQDKw,2757253
|
|
5
|
-
rnet/__init__.py,sha256=gqet5qGPHqS1VRr8XjzpQOuYetNn-aLss4lTR7cZ_9M,317
|
|
6
|
-
rnet/__init__.pyi,sha256=kJeqrw-tbxxYhNi0LVBSVEVU4OjZGV9--qydDZuSQh8,29217
|
|
7
|
-
rnet/blocking.py,sha256=FyisL3Hqdz6Oeq1e3LXgVcVW_-hmrF-rI3RgSWkaWN0,11447
|
|
8
|
-
rnet/cookie.py,sha256=7RIGN5PvA3JoZ4WS6gpJjB8OgUqyx1pYBk6SefJRa2A,2870
|
|
9
|
-
rnet/emulation.py,sha256=3DLfnKGQDIXlkyfF32B8na3_MOIpeTDkywRXtocI8jQ,5021
|
|
10
|
-
rnet/exceptions.py,sha256=pr8RNPhr_CswkdKgZGvamSFwyrHE6OPQk72YcJACNBo,5906
|
|
11
|
-
rnet/header.py,sha256=XycnM2sejBt_JauZIdM3ejywD3iX4GJQP10cAPSNLyU,11863
|
|
12
|
-
rnet/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
rnet/rnet.abi3.so,sha256=B-bKW_1zzHscNXxQxXW9A3jsnGXeHhfbUX6MjfNPa-A,7508329
|
|
14
|
-
rnet/tls.py,sha256=v-BFEiNRcfmYMqP2Bgeyig-Jzyw6ncjx39qSf2Ad_Oc,4803
|
|
15
|
-
rnet-3.0.0rc2.dist-info/RECORD,,
|
|
File without changes
|