import requests _url = "http://127.0.0.1:8000/test2/" files = { "image": ("e.jpg", open(r"C:\Users\wuhao\Desktop\e.jpg", ‘rb‘), "image/jpeg"), } data = { "site_id": "2132" } requests.post(url=_url, files=files, data=data)
2024-01-02 12:44:47
import requests _url = "http://127.0.0.1:8000/test2/" files = { "image": ("e.jpg", open(r"C:\Users\wuhao\Desktop\e.jpg", ‘rb‘), "image/jpeg"), } data = { "site_id": "2132" } requests.post(url=_url, files=files, data=data)