Skip to content

Commit

Permalink
Update http
Browse files Browse the repository at this point in the history
  • Loading branch information
shenghui0779 committed Dec 13, 2023
1 parent b841f02 commit f16e997
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,13 @@ func HTTPPost(ctx context.Context, reqURL string, body []byte, options ...HTTPOp

// HTTPPostJSON 发送POST请求(json数据)
func HTTPPostJSON(ctx context.Context, reqURL string, body []byte, options ...HTTPOption) (*http.Response, error) {
options = append(options, WithHTTPHeader(HeaderContentType, ContentForm))

options = append(options, WithHTTPHeader(HeaderContentType, ContentJSON))
return defaultHttpCli.Do(ctx, http.MethodPost, reqURL, body, options...)
}

// HTTPPostForm 发送POST表单请求
func HTTPPostForm(ctx context.Context, reqURL string, data url.Values, options ...HTTPOption) (*http.Response, error) {
options = append(options, WithHTTPHeader(HeaderContentType, ContentForm))

return defaultHttpCli.Do(ctx, http.MethodPost, reqURL, []byte(data.Encode()), options...)
}

Expand Down

0 comments on commit f16e997

Please sign in to comment.