2024-03-04 12:27:57 +08:00

21 lines
577 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!D:\Python311\python.exe
# -*- coding: utf-8 -*-
# @Time : 2024/2/26 19:54
# @Author : DC_DC
import requests
url = 'https://www.baidu.com/'
response1 = requests.get(url)
response2 = requests.post(url)
print(response1)
print(response2)
print("常见参数:")
print("网址:", response1.url)
print("编码:", response1.encoding)
print("密钥:", response1.cookies)
print("请求头:", response1.headers)
print("响应状态码", response1.status_code)
print("内容:", response1.text[:80])
print("内容(二进制形式返回)", response1.content[:80])
pass