NSFW

FREEMIUM
Durch qaix | Aktualisiert 2ヶ月前 | Visual Recognition
Health Check

N/A

Zurück zu allen Diskussionen

Python Implementation

Rapid account: Yash Gupta 755

Can anyone help me with Python implementation?

import requests

import base64

with open(“demo.jpg”, “rb”) as img_file:
my_string = base64.b64encode(img_file.read())

url = “https://nsfw1.p.rapidapi.com/nsfw

payload = my_string

files = {
‘file’: open(“demo.jpg”, ‘rb’)
}

headers = {
‘x-rapidapi-host’: “nsfw1.p.rapidapi.com”,
‘x-rapidapi-key’: “”,
‘content-type’: “multipart/form-data”
}

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

print(response.text)

Rapid account: Qaix
qaix Commented 4年前

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

Anmelden / Registrieren, um neue Kommentare zu veröffentlichen