1
This commit is contained in:
@@ -104,6 +104,7 @@ func (a *API) FileUpload(filePath, imgType, sourcechnl, isOcr string) (*UploadIm
|
||||
}
|
||||
|
||||
// 设置 Content-Type 头
|
||||
a.CheckToken()
|
||||
req.Header.Set("Content-Type", writer.FormDataContentType())
|
||||
req.Header.Set("Authorization", fmt.Sprintf("bearer %s", a.incomingToken))
|
||||
|
||||
|
||||
@@ -78,8 +78,8 @@ func TestGetCustomAndCategoryList(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUploadImg(t *testing.T) {
|
||||
filePath := "https://image.jxc4.com/image/7325d87faa6179e0d86dad9ae27cbbc1.jpg"
|
||||
data, err := api.FileUpload(filePath, IdCardFront, "0", "false")
|
||||
filePath := "https://image.jxc4.com/image/3559d4696be3bf241ee6b89ca3713cf7.pdf"
|
||||
data, err := api.FileUpload(filePath, "SPLIT_ENTRUST_FILE", "0", "false")
|
||||
if err != nil {
|
||||
fmt.Printf("Error: %v\n", err)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user