mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
REQUEST with unknown and undetectable encoding (#600)
This commit is contained in:
@@ -740,12 +740,12 @@ class Response(object):
|
||||
"""
|
||||
Similar to the Response class from the `requests` library.
|
||||
"""
|
||||
def __init__(self, content, status, statusText, headers, encoding):
|
||||
def __init__(self, content, status, statusText, headers, encoding=None):
|
||||
self.content = content # raw bytes
|
||||
self.status_code = status # e.g. 404
|
||||
self.reason = statusText # e.g. "Not Found"
|
||||
self.headers = CaseInsensitiveDict(headers)
|
||||
self.encoding = encoding or self.apparent_encoding
|
||||
self.encoding = encoding or self.apparent_encoding or "utf-8"
|
||||
|
||||
@property
|
||||
def text(self):
|
||||
|
||||
Reference in New Issue
Block a user