forked from psf/requests
-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3.13.0 (2025-02-06) ------------------- **Removed** - Dependency on `idna`. Since qh3 version 1.4, we can rely on their internal idna encoder that does not require any external dependencies. This change does not affect the feature on international domain names. If `idna` is installed, it will be used instead. - Dependency on `kiss-headers`. We decided to vendor kiss-headers into Niquests for several reasons. The principal one is that the project is stable and require next to no maintenance. And pulling extra dependencies affect some end-users. We are in the process of measuring potential interest for kiss-headers models. We may decide to remove its support completely in a next major version.
- Loading branch information
Showing
33 changed files
with
4,088 additions
and
8,743 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,9 @@ | |
__url__: str = "https://niquests.readthedocs.io" | ||
|
||
__version__: str | ||
__version__ = "3.12.3" | ||
__version__ = "3.13.0" | ||
|
||
__build__: int = 0x031203 | ||
__build__: int = 0x031300 | ||
__author__: str = "Kenneth Reitz" | ||
__author_email__: str = "[email protected]" | ||
__license__: str = "Apache-2.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 TAHRI Ahmed R. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
""" | ||
Kiss-Headers | ||
~~~~~~~~~~~~~~ | ||
Kiss-Headers is a headers, HTTP or IMAP4 _(message, email)_ flavour, utility, written in pure Python, for humans. | ||
Object oriented headers. Keep it sweet and simple. | ||
Basic usage: | ||
>>> import requests | ||
>>> from kiss_headers import parse_it | ||
>>> r = requests.get('https://www.python.org') | ||
>>> headers = parse_it(r) | ||
>>> 'charset' in headers.content_type | ||
True | ||
>>> headers.content_type.charset | ||
'utf-8' | ||
>>> 'text/html' in headers.content_type | ||
True | ||
>>> headers.content_type == 'text/html' | ||
True | ||
>>> headers -= 'content-type' | ||
>>> 'Content-Type' in headers | ||
False | ||
... or from a raw IMAP4 message: | ||
>>> message = requests.get("https://gist.githubusercontent.com/Ousret/8b84b736c375bb6aa3d389e86b5116ec/raw/21cb2f7af865e401c37d9b053fb6fe1abf63165b/sample-message.eml").content | ||
>>> headers = parse_it(message) | ||
>>> 'Sender' in headers | ||
True | ||
Others methods and usages are available - see the full documentation | ||
at <https://github.com/jawah/kiss-headers>. | ||
:copyright: (c) 2020 by Ahmed TAHRI | ||
:license: MIT, see LICENSE for more details. | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from .api import dumps, explain, get_polymorphic, parse_it | ||
from .builder import ( | ||
Accept, | ||
AcceptEncoding, | ||
AcceptLanguage, | ||
Allow, | ||
AltSvc, | ||
Authorization, | ||
BasicAuthorization, | ||
CacheControl, | ||
Connection, | ||
ContentDisposition, | ||
ContentEncoding, | ||
ContentLength, | ||
ContentRange, | ||
ContentSecurityPolicy, | ||
ContentType, | ||
CrossOriginResourcePolicy, | ||
CustomHeader, | ||
Date, | ||
Digest, | ||
Dnt, | ||
Etag, | ||
Expires, | ||
Forwarded, | ||
From, | ||
Host, | ||
IfMatch, | ||
IfModifiedSince, | ||
IfNoneMatch, | ||
IfUnmodifiedSince, | ||
KeepAlive, | ||
LastModified, | ||
Location, | ||
ProxyAuthorization, | ||
Referer, | ||
ReferrerPolicy, | ||
RetryAfter, | ||
Server, | ||
SetCookie, | ||
StrictTransportSecurity, | ||
TransferEncoding, | ||
UpgradeInsecureRequests, | ||
UserAgent, | ||
Vary, | ||
WwwAuthenticate, | ||
XContentTypeOptions, | ||
XDnsPrefetchControl, | ||
XFrameOptions, | ||
XXssProtection, | ||
) | ||
from .models import Attributes, Header, Headers, lock_output_type | ||
from .serializer import decode, encode | ||
from .version import VERSION, __version__ | ||
|
||
__all__ = ( | ||
"dumps", | ||
"explain", | ||
"get_polymorphic", | ||
"parse_it", | ||
"Attributes", | ||
"Header", | ||
"Headers", | ||
"lock_output_type", | ||
"decode", | ||
"encode", | ||
"VERSION", | ||
"__version__", | ||
"Accept", | ||
"AcceptEncoding", | ||
"AcceptLanguage", | ||
"Allow", | ||
"AltSvc", | ||
"Authorization", | ||
"BasicAuthorization", | ||
"CacheControl", | ||
"Connection", | ||
"ContentDisposition", | ||
"ContentEncoding", | ||
"ContentLength", | ||
"ContentRange", | ||
"ContentSecurityPolicy", | ||
"ContentType", | ||
"CrossOriginResourcePolicy", | ||
"CustomHeader", | ||
"Date", | ||
"Digest", | ||
"Dnt", | ||
"Etag", | ||
"Expires", | ||
"Forwarded", | ||
"From", | ||
"Host", | ||
"IfMatch", | ||
"IfModifiedSince", | ||
"IfNoneMatch", | ||
"IfUnmodifiedSince", | ||
"KeepAlive", | ||
"LastModified", | ||
"Location", | ||
"ProxyAuthorization", | ||
"Referer", | ||
"ReferrerPolicy", | ||
"RetryAfter", | ||
"Server", | ||
"SetCookie", | ||
"StrictTransportSecurity", | ||
"TransferEncoding", | ||
"UpgradeInsecureRequests", | ||
"UserAgent", | ||
"Vary", | ||
"WwwAuthenticate", | ||
"XContentTypeOptions", | ||
"XDnsPrefetchControl", | ||
"XFrameOptions", | ||
"XXssProtection", | ||
) |
Oops, something went wrong.