AI Background Remover

FREEMIUM
Durch Firdavs Shodiyev | Aktualisiert 2 месяца назад | Artificial Intelligence/Machine Learning
Popularität

9.3 / 10

Latenz

2,864ms

Service Level

100%

Health Check

N/A

Zurück zu allen Diskussionen

Image file is missing Error

Rapid account: Ajaywltest 2
ajaywltest2
24 дня назад

Hi there , eventhough I took the code snippet directly from rapid api , it shows error that the image file is missing. The image file is in the correct folder but still its occuring, May I know why

Here’s my code snippet:

import requests

url = “https://ai-background-remover.p.rapidapi.com/image/matte/v1

files = { “image”: “open(‘test.png’, ‘rb’)” }
headers = {
“X-RapidAPI-Key”: “123”,
“X-RapidAPI-Host”: “ai-background-remover.p.rapidapi.com
}

response = requests.post(url, files=files, headers=headers)

print(response.json())

Rapid account: Firdavscoder 1
firdavscoder1 Commented 24 дня назад

Try this. There is code generator on RapidAPI and you can convert into any coding languages

import requests

url = “https://ai-background-remover.p.rapidapi.com/image/matte/v1

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=“image”\r\n\r\n\r\n-----011000010111000001101001–\r\n\r\n"
headers = {
“content-type”: “multipart/form-data; boundary=—011000010111000001101001”,
“X-RapidAPI-Key”: “API_Key”,
“X-RapidAPI-Host”: “ai-background-remover.p.rapidapi.com
}

response = requests.post(url, data=payload, headers=headers)

print(response.json())

Nehmen Sie an der Diskussion teil - fügen Sie unten einen Kommentar hinzu:

Anmelden / Registrieren, um neue Kommentare zu veröffentlichen