enhance: [GoSDK] Add content-type header for bulk import req (#38581)

Related to #31293
Previous PR: #38493

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/38610/head
congqixia 2024-12-20 10:28:47 +08:00 committed by GitHub
parent c0b855dc75
commit a728646534
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -131,6 +131,7 @@ func BulkImport(ctx context.Context, option *BulkImportOption) (*BulkImportRespo
if err != nil {
return nil, err
}
req.Header.Set("Content-Type", "application/json")
if option.APIKey != "" {
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", option.APIKey))
}
@ -208,6 +209,7 @@ func ListImportJobs(ctx context.Context, option *ListImportJobsOption) (*ListImp
if err != nil {
return nil, err
}
req.Header.Set("Content-Type", "application/json")
if option.APIKey != "" {
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", option.APIKey))
}
@ -293,6 +295,7 @@ func GetImportProgress(ctx context.Context, option *GetImportProgressOption) (*G
if err != nil {
return nil, err
}
req.Header.Set("Content-Type", "application/json")
if option.APIKey != "" {
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", option.APIKey))
}