Skip to content

Commit

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

Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia authored Dec 20, 2024
1 parent c0b855d commit a728646
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 a728646

Please sign in to comment.