Skip to content

Latest commit

Β 

History

History
53 lines (37 loc) Β· 1.43 KB

File metadata and controls

53 lines (37 loc) Β· 1.43 KB

TlsClient.RestSharp

Integration of TlsClient.NET with RestSharp. This package allows you to make HTTP requests using RestSharp while benefiting from advanced TLS fingerprinting and browser emulation features provided by TlsClient.NET.

πŸ“¦ Installation

Install from NuGet:

dotnet add package TlsClient.Provider.RestSharp

πŸš€ Usage

Basic Example

πŸ’‘ TlsRestClientBuilder returns a standard RestClient instance. That means you can continue using all features of RestSharp exactly the same way as before.

using RestSharp;
using TlsClient.Core;
using TlsClient.RestSharp.Helpers.Builders;

// initialize Wrapper
TlsClient.Initialize("{LIBRARY_PATH}");

// initialize TlsClient with desired options
var tlsClient = new TlsClientBuilder()
    .WithIdentifier(TlsClientIdentifier.Chrome133)
    .WithUserAgent("TlsClient.NET 1.0")
    .Build();

// build RestClient with TlsRestClientBuilder
var restClient = new TlsRestClientBuilder()
    .WithTlsClient(tlsClient)
    .WithBaseUrl("https://httpbin.org")
    .WithCookieContainer(CookieContainer? cookieContainer= null)
    .Build();

// make request
var request = new RestRequest("/get", Method.Get);
var response = await restClient.ExecuteAsync(request);

Console.WriteLine(response.Content);

πŸ“œ License

This project is licensed under the MIT License. See the LICENSE file for details.