Skip to content

Commit

Permalink
enhance: [GoSDK] Add content-type header for bulk import req
Browse files Browse the repository at this point in the history
Related to milvus-io#31293
Previous PR: milvus-io#38493

Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia committed Dec 19, 2024
1 parent 306e5e6 commit 5a419d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/bulkwriter/bulk_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down Expand Up @@ -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))
}
Expand Down Expand Up @@ -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))
}
Expand Down

0 comments on commit 5a419d9

Please sign in to comment.