chore: Use http constants to replace numbers as parameters

Signed-off-by: xin.li <xin.li@daocloud.io>
This commit is contained in:
xin.li
2023-02-19 20:41:10 +08:00
committed by Benjamin Wang
parent 8e56e2f5ce
commit b17b9c1428
13 changed files with 23 additions and 23 deletions

View File

@ -64,7 +64,7 @@ func newStreamRoundTripper(tlsInfo transport.TLSInfo, dialTimeout time.Duration)
func createPostRequest(lg *zap.Logger, u url.URL, path string, body io.Reader, ct string, urls types.URLs, from, cid types.ID) *http.Request {
uu := u
uu.Path = path
req, err := http.NewRequest("POST", uu.String(), body)
req, err := http.NewRequest(http.MethodPost, uu.String(), body)
if err != nil {
if lg != nil {
lg.Panic("unexpected new request error", zap.Error(err))