接口文檔可參考以下內容
1.利用postman的方式提交圖片
1.1在head中添加這個格式
1.2上傳圖片文件
postman默認是文本格式,因為是圖片就選擇File,在value中就會顯示一個選擇框,選擇你要上傳的圖片,如下圖,less1就是我選擇圖片,執行,生成了一個sigid,說明接口執行成功
2.使用接口方式提交圖片
def test_image(self): imagepsth='E:\\jcacheworkspace\\dev-auto-script\\jsms\\TestData\\less1.jpg' #圖片路徑 files = [('sign', (None, "zhangjun"))] #必填內容的sign images = open(imagepsth, 'rb') #獲取圖片句柄,所以要讀取圖片 files =files+[('images', ('less1.jpg',images))] 以文件格式上傳 print(files) response =requests.post("http://XXXX/v1/sign", files=files, auth=("認證的appkey","7f02767fda54ea83388865e0")) print(response.json())