Toonify

フリーミアム
よって Toonify | 更新済み 16日前 | Video, Images
人気

9.4 / 10

レイテンシー

12,197ms

サービスレベル

100%

Health Check

N/A

すべてのディスカッションに戻る

Error "Missing RapidAPI application key"【Not Missing】

Rapid account: Llf 226
llf226
4年前

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 4年前

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!

ディスカッションに参加しましょう-以下にコメントを追加してください:

ログイン/サインアップして新しいコメントを投稿