SujaySarma.Sdk.RestApi 8.0.0

dotnet add package SujaySarma.Sdk.RestApi --version 8.0.0                
NuGet\Install-Package SujaySarma.Sdk.RestApi -Version 8.0.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="SujaySarma.Sdk.RestApi" Version="8.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SujaySarma.Sdk.RestApi --version 8.0.0                
#r "nuget: SujaySarma.Sdk.RestApi, 8.0.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.
// Install SujaySarma.Sdk.RestApi as a Cake Addin
#addin nuget:?package=SujaySarma.Sdk.RestApi&version=8.0.0

// Install SujaySarma.Sdk.RestApi as a Cake Tool
#tool nuget:?package=SujaySarma.Sdk.RestApi&version=8.0.0                

SujaySarma.Sdk.RestApi

Provides a way to interact with REST API services. Uses a shared HttpClient and provides methods to GET, PUT, POST, ... and perform all actions normally done using REST API services. There are also classes for different types of common results returned by the service.

This project has no dependencies on anything that is not a part of the .NET Core SDK/runtime.


Usage

Adds ability to instantiate the client in a number of ways. Two key changes are:

  1. Set the request timeout value. RestApiClient.RequestTimeout property. This is in seconds. You may set different values prior to each call since the property value is attached to the underlying HttpClient on every request.

  2. You can now use non-Json request body types (like form-encoded, etc). But, you need to use the CallApiMethod method. The Get(), Post() and other methods are simply wrappers on this method anyway. When using the CallApiMethod method, use its new contentType parameter to set the desired content type. This defaults to application/json.

Get latest from https://www.nuget.org/packages/SujaySarma.Sdk.RestApi/latest.

NOTE: As of v6.2.0, all methods are now async.

Release 6.2.0 added Fluid-style initialization. Use v6.2.2 or higher to use this type of code:

RestApiClient client = RestApiClient.CreateBuilder()
  .WithBearerToken("akjhakjsdhkahsd")
  .WithHeader("Custom-Header", "Value")
  .WithRequestUri("https://my.fancy.api");

HttpResponseMessage reply = await client.Get();

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on SujaySarma.Sdk.RestApi:

Package Downloads
SujaySarma.Sdk.RESTClient.Wikipedia

.NET Client for Wikipedia.org REST API. The client will be updated regularly to support all the operations that the REST endpoints support. If you come across missing features or bugs, do open an issue on Github and it will be addressed quickly.

SujaySarma.Sdk.WikipediaApi

.NET Client for Wikipedia.org REST API. The client will be updated regularly to support all the operations that the REST endpoints support. If you come across missing features or bugs, do open an issue on Github and it will be addressed quickly.

SujaySarma.Sdk.Azure.MarketplaceCatalog

Consume the data powering the Azure Portal's Create Resource workflow as an object model. Please follow the instructions at: https://github.com/sujayvsarma/AzureMarketplaceCatalogProvider/blob/master/README.md for using this library.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.0 94 6/24/2024
6.2.8 355 11/18/2022
6.2.7 407 9/7/2022
6.2.6 401 8/16/2022
6.2.5 557 8/7/2022
6.2.0 523 8/5/2022
6.0.2 655 5/31/2022
6.0.0 456 4/27/2022
2.5.0 546 2/4/2020
1.2.0 497 11/7/2019
1.1.0 929 9/30/2019
1.0.0 611 8/13/2019

Multi-platform (.NET 6 - 8.0) release, version bump to 8.0