Transfer-Encoding : chunked
Host: example.com
User-Agent: Smuggler/v1.0
Content-Length: 83
0
GET <URL> HTTP/1.1
X: X
您可以在正文中看到,我想在Content-Length之后和0之后发送一些黑线我试过了headers = {'user-agent':'bot','\ r \ n'}在标头后添加\ r \ n,但它不起作用我的代码
import request
url = "http://example.com"
headers = {'user-agent':'firefox',\r\n ,'Content-type':'application/json'}
response = request.get(url,headers=headers)
我无法发表评论,因此我必须在此处提供链接。 This shows how to add line breaks。您没有提供任何代码,因此很难提供正确的帮助。
看到代码后进行编辑:
您必须将'\r\n'
或更确切地说是'\n'
放在引号内。
示例:
a='\n'*3
print(f'hello{a}world')
### Outputs ###
# hello
#
#
# world