Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Provide an option to set default headers (and header orders) #68

Closed
3ldar opened this issue Aug 5, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@3ldar
Copy link

3ldar commented Aug 5, 2023

Describe the feature / enhancement and how it would improve things

I didn't find the proper settings to set the headers in a client-wise fashion. (Like in C# HttpClients SetDefaultRequestHeaders) It allows you to set headers for the client's lifetime. Setting a header in a request level will override the default headers. If it is absent it would be nice to have such a feature.

Describe how your proposal will work, with code and/or pseudo-code

options := []tlsClient.HttpClientOption{
		tlsClient.WithTimeoutSeconds(30),
		tlsClient.WithClientProfile(tlsClient.MappedTLSClients[tlsIdentifier]),
		//tlsClient.WithDebug(),
		tlsClient.WithRandomTLSExtensionOrder(),
		tlsClient.WithProxyUrl(proxy),
		tlsClient.WithNotFollowRedirects(),
		tlsClient.WithInsecureSkipVerify(),
		tlsClient.WithCookieJar(jar),
		tlsClient.WithCatchPanics(),
                tlsClient.WithDefaultHeaders(someHeadersHere), // <--
	}
@3ldar 3ldar added the enhancement New feature or request label Aug 5, 2023
@bogdanfinn
Copy link
Owner

Introduced in version v1.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants