Skip to content

允许用户使用自定义的http.Client? #167

@ricklxm

Description

@ricklxm

如下的代码中使用了硬编码的http.Client,能否使其允许调用方可以传递自定义的http.Client?

func (c JDCloudClient) doSend(method, url, data string, header map[string]string, timeout time.Duration, sign SignFunc) ([]byte, error) {
	client := &http.Client{Timeout: timeout}

	req, err := http.NewRequest(method, url, strings.NewReader(data))
	// ... 
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions