Guest User

Python POST request

a guest
Feb 21st, 2022
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. import requests
  3. data = {"txt": "ahoj"}
  4. url = "https://example.org"
  5. headers = {
  6. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36',
  7. }
  8. cookies_dict = {"klubovnatemp": "hashChatId", "personalizacetemp": "uid"}
  9. response = requests.post(url, data=data, headers=headers, cookies=cookies_dict);
  10.  
  11. # a výsledkem je chyba:
  12. # UnicodeEncodeError: 'latin-1' codec can't encode character '\u010d' in position 77: ordinal not in range(256)
Advertisement
Add Comment
Please, Sign In to add comment