connectionpool
ConnectionPool
Bases: object
Base class for all connection pools, such as :class:.HTTPConnectionPool
and :class:.HTTPSConnectionPool
.
.. note:: ConnectionPool.urlopen() does not normalize or percent-encode target URIs which is useful if your target server doesn't support percent-encoded target URIs.
Source code in client/ayon_fusion/vendor/urllib3/connectionpool.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
close()
Close all pooled connections and disable the pool.
Source code in client/ayon_fusion/vendor/urllib3/connectionpool.py
93 94 95 96 97 |
|
HTTPConnectionPool
Bases: ConnectionPool
, RequestMethods
Thread-safe connection pool for one host.
:param host: Host used for this HTTP Connection (e.g. "localhost"), passed into :class:http.client.HTTPConnection
.
:param port: Port used for this HTTP Connection (None is equivalent to 80), passed into :class:http.client.HTTPConnection
.
:param strict: Causes BadStatusLine to be raised if the status line can't be parsed as a valid HTTP/1.0 or 1.1 status line, passed into :class:http.client.HTTPConnection
.
.. note::
Only works in Python 2. This parameter is ignored in Python 3.
:param timeout: Socket timeout in seconds for each individual connection. This can be a float or integer, which sets the timeout for the HTTP request, or an instance of :class:urllib3.util.Timeout
which gives you more fine-grained control over request timeouts. After the constructor has been parsed, this is always a urllib3.util.Timeout
object.
:param maxsize: Number of connections to save that can be reused. More than 1 is useful in multithreaded situations. If block
is set to False, more connections will be created but they will not be saved once they've been used.
:param block: If set to True, no more than maxsize
connections will be used at a time. When no free connections are available, the call will block until a connection has been released. This is a useful side effect for particular multithreaded situations where one does not want to use more than maxsize connections per host to prevent flooding.
:param headers: Headers to include with all requests, unless other headers are given explicitly.
:param retries: Retry configuration to use by default with requests in this pool.
:param _proxy: Parsed proxy URL, should not be used directly, instead, see :class:urllib3.ProxyManager
:param _proxy_headers: A dictionary with proxy headers, should not be used directly, instead, see :class:urllib3.ProxyManager
:param **conn_kw: Additional parameters are used to create fresh :class:urllib3.connection.HTTPConnection
, :class:urllib3.connection.HTTPSConnection
instances.
Source code in client/ayon_fusion/vendor/urllib3/connectionpool.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 |
|
close()
Close all pooled connections and disable the pool.
Source code in client/ayon_fusion/vendor/urllib3/connectionpool.py
479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 |
|
is_same_host(url)
Check if the given url
is a member of the same host as this connection pool.
Source code in client/ayon_fusion/vendor/urllib3/connectionpool.py
497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 |
|
urlopen(method, url, body=None, headers=None, retries=None, redirect=True, assert_same_host=True, timeout=_Default, pool_timeout=None, release_conn=None, chunked=False, body_pos=None, **response_kw)
Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details.
.. note::
More commonly, it's appropriate to use a convenience method provided by :class:.RequestMethods
, such as :meth:request
.
.. note::
release_conn
will only behave as expected if preload_content=False
because we want to make preload_content=False
the default behaviour someday soon without breaking backwards compatibility.
:param method: HTTP request method (such as GET, POST, PUT, etc.)
:param url: The URL to perform the request on.
:param body: Data to send in the request body, either :class:str
, :class:bytes
, an iterable of :class:str
/:class:bytes
, or a file-like object.
:param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers.
:param retries: Configure the number of retries to allow before raising a :class:~urllib3.exceptions.MaxRetryError
exception.
Pass ``None`` to retry until you receive a response. Pass a
:class:`~urllib3.util.retry.Retry` object for fine-grained control
over different types of retries.
Pass an integer number to retry connection errors that many times,
but no other types of errors. Pass zero to never retry.
If ``False``, then retries are disabled and any exception is raised
immediately. Also, instead of raising a MaxRetryError on redirects,
the redirect response will be returned.
:type retries: :class:~urllib3.util.retry.Retry
, False, or an int.
:param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too.
:param assert_same_host: If True
, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When False
, you can use the pool on an HTTP proxy and request foreign hosts.
:param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:urllib3.util.Timeout
.
:param pool_timeout: If set and the pool is set to block=True, then this method will block for pool_timeout
seconds and raise EmptyPoolError if no connection is available within the time period.
:param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when preload_content=True
). This is useful if you're not preloading the response's content immediately. You will need to call r.release_conn()
on the response r
to return the connection back into the pool. If None, it takes the value of response_kw.get('preload_content', True)
.
:param chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False.
:param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed.
:param **response_kw: Additional parameters are passed to :meth:urllib3.response.HTTPResponse.from_httplib
Source code in client/ayon_fusion/vendor/urllib3/connectionpool.py
518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 |
|
HTTPSConnectionPool
Bases: HTTPConnectionPool
Same as :class:.HTTPConnectionPool
, but HTTPS.
:class:.HTTPSConnection
uses one of assert_fingerprint
, assert_hostname
and host
in this order to verify connections. If assert_hostname
is False, no verification is done.
The key_file
, cert_file
, cert_reqs
, ca_certs
, ca_cert_dir
, ssl_version
, key_password
are only used if :mod:ssl
is available and are fed into :meth:urllib3.util.ssl_wrap_socket
to upgrade the connection socket into an SSL socket.
Source code in client/ayon_fusion/vendor/urllib3/connectionpool.py
865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 |
|
connection_from_url(url, **kw)
Given a url, return an :class:.ConnectionPool
instance of its host.
This is a shortcut for not having to parse out the scheme, host, and port of the url before creating an :class:.ConnectionPool
instance.
:param url: Absolute URL string that must include the scheme. Port is optional.
:param **kw: Passes additional parameters to the constructor of the appropriate :class:.ConnectionPool
. Useful for specifying things like timeout, maxsize, headers, etc.
Example::
>>> conn = connection_from_url('http://google.com/')
>>> r = conn.request('GET', '/')
Source code in client/ayon_fusion/vendor/urllib3/connectionpool.py
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 |
|