D
D
dendite2021-08-22 19:29:33
Python
dendite, 2021-08-22 19:29:33

'latin-1' codec can't encode characters in requests???

Hello! There was a problem when working with Epic Games services.

I'm trying to make a request to one of the services, but I'm getting the error 'latin-1' codec can't encode characters in position 81-84: ordinal not in range(256).

req = requests.Session()
r = req.post(f'https://fortnite-public-service-prod11.ol.epicgames.com/fortnite/api/game/v2/profile/{id}/client/QueryProfile?profileId=campaign&rvn=-1', 
headers={"Authorization": f"bearer {d}","Content-Type": "application/json"},
data='{}')


What can be wrong?

PS - this is what sys.getfilesystemencoding() and locale.getpreferredencoding() tell me:
utf-8
cp1251

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2021-08-22
@dendite

We look at the documentation , it seems that data cannot be a string.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question