Skip to content

Commit

Permalink
add global wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
imroc committed Jul 31, 2023
1 parent 8ca2a65 commit 63fafa0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions client_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,18 @@ func SetCommonHeader(key, value string) *Client {
return defaultClient.SetCommonHeader(key, value)
}

// SetCommonHeaderOrder is a global wrapper methods which delegated
// to the default client's Client.SetCommonHeaderOrder.
func SetCommonHeaderOrder(keys ...string) *Client {
return defaultClient.SetCommonHeaderOrder(keys...)
}

// SetCommonPseudoHeaderOder is a global wrapper methods which delegated
// to the default client's Client.SetCommonPseudoHeaderOder.
func SetCommonPseudoHeaderOder(keys ...string) *Client {
return defaultClient.SetCommonPseudoHeaderOder(keys...)
}

// SetCommonContentType is a global wrapper methods which delegated
// to the default client's Client.SetCommonContentType.
func SetCommonContentType(ct string) *Client {
Expand Down
12 changes: 12 additions & 0 deletions request_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,18 @@ func SetHeader(key, value string) *Request {
return defaultClient.R().SetHeader(key, value)
}

// SetHeaderOrder is a global wrapper methods which delegated
// to the default client, create a request and SetHeaderOrder for request.
func SetHeaderOrder(keys ...string) *Request {
return defaultClient.R().SetHeaderOrder(keys...)
}

// SetPseudoHeaderOrder is a global wrapper methods which delegated
// to the default client, create a request and SetPseudoHeaderOrder for request.
func SetPseudoHeaderOrder(keys ...string) *Request {
return defaultClient.R().SetPseudoHeaderOrder(keys...)
}

// SetOutputFile is a global wrapper methods which delegated
// to the default client, create a request and SetOutputFile for request.
func SetOutputFile(file string) *Request {
Expand Down

0 comments on commit 63fafa0

Please sign in to comment.