resty库基本使用

在 golang中对接接口文档

假如你作为客户端对接别人的接口文档

使用 resty库

构建 multipart/form-data的请求

使用resty

client := resty.New()  
client.R().SetFile(key, filePath)   
    SetFormData(  
    map[string]string{  
       "fileType":   fileType,  
       "caseId":     caseID,  
       "fileSource": fileSource,  
       "fileDesc":   fileDesc,  
       "fileTime":   fileTime,  
    })
posted @ 2024-02-04 21:07  潜行1  阅读(101)  评论(0)    收藏  举报