Daktela.HttpClient 0.6.0

dotnet add package Daktela.HttpClient --version 0.6.0
                    
NuGet\Install-Package Daktela.HttpClient -Version 0.6.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Daktela.HttpClient" Version="0.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Daktela.HttpClient" Version="0.6.0" />
                    
Directory.Packages.props
<PackageReference Include="Daktela.HttpClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Daktela.HttpClient --version 0.6.0
                    
#r "nuget: Daktela.HttpClient, 0.6.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Daktela.HttpClient@0.6.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Daktela.HttpClient&version=0.6.0
                    
Install as a Cake Addin
#tool nuget:?package=Daktela.HttpClient&version=0.6.0
                    
Install as a Cake Tool

Build Status NuGet MyGet feedz.io

Daktela Http Client

How to configure library

Add library to the dependency container

using Daktela.HttpClient.Configuration;
using Daktela.HttpClient.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using System;

IServiceCollection serviceCollection;

serviceCollection.AddDaktelaHttpClient((DaktelaOptions configuration) => {
  configuration.ApiDomain = "https://<domain>.daktela.com";
  configuration.AccessToken = "<AccessToken>";
  // HTTP request timeout
  configuration.Timeout = TimeSpan.FromSeconds(60);
  // Should match with timezone on the Daktela server
  configuration.DateTimeOffset = TimeSpan.FromMinutes(60);
});

How to use library

using Daktela.HttpClient.Api.Contacts;
using Daktela.HttpClient.Api.Requests;
using Daktela.HttpClient.Implementations;
using Daktela.HttpClient.Interfaces.Endpoints;
using Daktela.HttpClient.Interfaces.Responses;
using System.Threading;
using System.Threading.Tasks;

public class MyService {
  private readonly IContactEndpoint _contactEndpoint;

  public MyService(IContactEndpoint contactEndpoint) {
    _contactEndpoint = contactEndpoint;
  }

  public async Task CallApiGet(CancellationToken cancellationToken = default) {
    Contact contact = await _contactEndpoint.GetContactAsync("<contactUniqueName>", cancellationToken);
  }

  public async Task CallApiGetList(CancellationToken cancellationToken = default)
  {
    var responseBehaviour = new TotalRecordsResponseBehaviour();
    // or you can simply use an empty response behavior as follow
    var emptyResponseBehaviour = ResponseBehaviourBuilder.CreateEmpty();

    await foreach(
      var contact in _contactEndpoint.GetContactsAsync(
        RequestBuilder.CreatePaged(new Paging(0, 20)),
        RequestOptionBuilder.CreateAutoPagingRequestOption(false),
        responseBehaviour,
        cancellationToken
      ).WithCancellation(cancellationToken)
    )
    {
      var contactName = contact.Name;
    }

    var totalRecords = responseBehaviour.TotalRecords;
  }

  private class TotalRecordsResponseBehaviour : ITotalRecordsResponseBehaviour
  {
    public int? TotalRecords { get; private set; }

    public void SetTotalRecords(int totalRecords) => TotalRecords = totalRecords;
  }
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.6.0 288 11/12/2025
0.5.1 286 11/12/2025
0.5.0 206 11/18/2024
0.4.1 298 6/24/2024
0.4.0 325 11/15/2023
0.3.0 263 6/5/2023
0.2.1 383 2/15/2023