mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
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>
This commit is contained in:
parent
c0b855dc75
commit
a728646534
@ -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))
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user