0
Transfer-Encoding : chunked
Host: example.com
User-Agent: Smuggler/v1.0
Content-Length: 83

0

GET <URL> HTTP/1.1
X: X

as you can see in body i want to send some black line after Content-Length and after 0 i tried headers={'user-agent':'bot','\r\n'} adding \r\n after headers but it is not working my code

import request 

url = "http://example.com" 
headers = {'user-agent':'firefox',\r\n ,'Content-type':'application/json'}
response = request.get(url,headers=headers)

1 Answers1

0

I can't comment, so I had to provide the link here. This shows how to add line breaks. You didn't provide any code, which makes it difficult to provide the correct help.

Edit after seeing code:

You have to place '\r\n' or rather '\n' inside quote marks.

Example:

a='\n'*3
print(f'hello{a}world')
### Outputs ###
# hello
# 
# 
# world
Stuart
  • 465
  • 3
  • 6