Toonify

FREEMIUM
Por Toonify | Atualizado vor 16 Tagen | Video, Images
Popularidade

9.4 / 10

Latência

12,197ms

Nível de serviço

100%

Health Check

N/A

Voltar para todas as discussões

Error "Missing RapidAPI application key"【Not Missing】

Rapid account: Llf 226
llf226
vor 4 Jahren

When i just copy and paste the example then i get the error:“Missing RapidAPI application key”.

I have no idea why its not working. Can you please help me.

Greetings
Longfei Lin

here is my code

`import requests

url = "https://toonify.p.rapidapi.com/v0/toonify"
query = {
“x-rapidapi-host”: “toonify.p.rapidapi.com”,
“x-rapidapi-key”: “my key~~~~not missing”,
“accept”: “application/json”,
}
headers = {“accept”: “application/json”}
files = {“image”: open(“img.png”, “rb”)}

response = requests.request(“POST”, url, files=files, headers=headers, params=query)

print(response.json())`

Rapid account: Justinpinkney
justinpinkney Commented vor 4 Jahren

Sorry, this was my fault in some terrible copy and pasting for the example. It should look like this:

import requests

url = "https://toonify.p.rapidapi.com/v0/toonify"
headers= {
"x-rapidapi-host": "toonify.p.rapidapi.com",
"x-rapidapi-key": "my key~~~~not missing",
"accept": "application/json",
}
files = {"image": open("img.png", "rb")}

response = requests.request("POST", url, files=files, headers=headers)

print(response.json())

the api key etc should be in headers not the query. I’ll update the documentation shortly. Apologies again!

Junte-se à discussão - adicione o comentário abaixo:

Efetue login / inscreva-se para postar novos comentários