AI Background Remover

GRATIS CON POSSIBILITÀ DI UPGRADE
Popolarità

9.3 / 10

Latenza

2,864ms

Livello di servizio

100%

Health Check

N/A

Torna a tutte le discussioni

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())

Partecipa alla discussione - aggiungi un commento di seguito:

Accedi/Iscriviti per pubblicare nuovi commenti