mirror of https://github.com/milvus-io/milvus.git
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
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…
Reference in New Issue