models¶
Response()¶
- class
requests.models.
Response
¶ -
content
¶ with open('index.html', 'wb') as f: f.write(response.content)
-
headers
¶ response.headers # {'Content-Type': 'text/html; charset=utf-8'}
-
status_code
¶ response.status_code # 200
-
text
¶ response.text # '<!doctype html> ...'
-
url
¶ response.url # 'ilnurgi.ru?q=ilnurgi.ru'
-
json
()¶ Возвращает словарь, преобразованный из ответа в формате json.
response.json() # {'q': 'ilnurgi.ru'}
-