From a728646534cb57ce3467631e57df35a9af5ff02f Mon Sep 17 00:00:00 2001 From: congqixia Date: Fri, 20 Dec 2024 10:28:47 +0800 Subject: [PATCH] enhance: [GoSDK] Add content-type header for bulk import req (#38581) Related to #31293 Previous PR: #38493 Signed-off-by: Congqi Xia --- client/bulkwriter/bulk_import.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/bulkwriter/bulk_import.go b/client/bulkwriter/bulk_import.go index 16813600b5eb9..fb0226a6886c3 100644 --- a/client/bulkwriter/bulk_import.go +++ b/client/bulkwriter/bulk_import.go @@ -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)) }