Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
兰师鹏 committed Sep 29, 2023
1 parent 39e0859 commit 5d21c73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions replayer-agent/common/handlers/httpclient/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (hc *HttpClient) Get(ctx context.Context, url string) (*http.Response, []by
tlog.Handler.Errorf(ctx, tlog.DLTagUndefined, err.Error())
return nil, nil, err
}
req.SetBasicAuth("elastic", "ES_test_7")
req.SetBasicAuth("username", "password")
req.Header.Set("Content-Type", "application/x-www-form-urlencoded;charset=utf-8")

client := &http.Client{}
Expand All @@ -49,7 +49,7 @@ func (hc *HttpClient) Post(ctx context.Context, url string, jsonBytes []byte, ti
tlog.Handler.Errorf(ctx, tlog.DLTagUndefined, err.Error())
return nil, nil, err
}
req.SetBasicAuth("elastic", "ES_test_7")
req.SetBasicAuth("username", "password")
//默认 application/json
req.Header.Set("Content-Type", "application/json;charset=utf-8")
//headers 优先级更高
Expand Down

0 comments on commit 5d21c73

Please sign in to comment.