如果接口只需要上传文件,
#path:是文件的绝对路径,
file_name, binary_io, contype = os.path.basename(path), open(path, 'rb'), 'image/png'
file={
'file': (file_name, binary_io, contype)
}
resp = requests.post(url, files<
如果接口只需要上传文件,
#path:是文件的绝对路径,
file_name, binary_io, contype = os.path.basename(path), open(path, 'rb'), 'image/png'
file={
'file': (file_name, binary_io, contype)
}
resp = requests.post(url, files<