P
P
PesyCorm2021-01-19 21:58:31
Python
PesyCorm, 2021-01-19 21:58:31

How to correctly specify api parameters in python requests?

Hey! I do not quite understand how to correctly specify the api parameters for https://fakerapi.it/en
In my case:

url = "https://fakerapi.it/api/v1/texts"
param1 = 1
param2 = 1
query = {"_quantity":param1, "_characters":param2}
response = requests.get(url, params=query)

returns 500 error. Tell me what is wrong? Thanks for the answer!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2021-01-19
@PesyCorm

I don't see something in the _characters parameter in the docks. Try specifying without it:
query = {"_quantity":param1}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question