NSFW

फ्रीमियम
द्वारा qaix | अपडेट किया गया לפני חודשיים | Visual Recognition
Health Check

N/A

सभी चर्चाओं पर वापस जाएं

Python Implementation

Rapid account: Yash Gupta 755
yash.gupta755
לפני 4 שנים

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 שנים

चर्चा में शामिल हों - नीचे टिप्पणी जोड़ें:

नई टिप्पणियाँ पोस्ट करने के लिए लॉग इन / साइनअप करें