SpanFlow.Connectors.Http
1.0.0
dotnet add package SpanFlow.Connectors.Http --version 1.0.0
NuGet\Install-Package SpanFlow.Connectors.Http -Version 1.0.0
<PackageReference Include="SpanFlow.Connectors.Http" Version="1.0.0" />
<PackageVersion Include="SpanFlow.Connectors.Http" Version="1.0.0" />
<PackageReference Include="SpanFlow.Connectors.Http" />
paket add SpanFlow.Connectors.Http --version 1.0.0
#r "nuget: SpanFlow.Connectors.Http, 1.0.0"
#:package SpanFlow.Connectors.Http@1.0.0
#addin nuget:?package=SpanFlow.Connectors.Http&version=1.0.0
#tool nuget:?package=SpanFlow.Connectors.Http&version=1.0.0
SpanFlow.Connectors.Http
Builds HTTP requests from a JSON description, the way an API tool does, and signs them with common API authentication schemes. It comes from SpanFlow, where it handles every HTTP call a pipeline makes.
Authentication schemes (IAuthStrategy, chosen by auth.type):
type |
Scheme |
|---|---|
none, apiKey (in a header, query or cookie), basic, bearer |
Static credentials |
oauth2ClientCredentials, tokenEndpoint, loginRequest |
A token that is fetched, cached and renewed before it expires |
digest |
HTTP Digest (RFC 7616: MD5 or SHA-256, qop=auth) |
hawk |
Hawk, with payload hashing |
oauth1 |
OAuth 1.0a (HMAC-SHA1/256/512, RSA-SHA1/256/512 or PLAINTEXT; in the header, query or form body) |
jwtBearer |
A JWT you sign (HS, RS, PS or ES with 256, 384 or 512), sent as a bearer token |
using System.Text.Json.Nodes;
using SpanFlow.Connectors.Http;
using SpanFlow.Connectors.Http.Auth;
var request = JsonNode.Parse("""
{
"method": "POST",
"path": "/v1/orders",
"query": { "dryRun": "true" },
"headers": { "X-Request-Id": "abc-123" },
"bodyType": "json",
"body": { "sku": "A-1", "qty": 2 }
}
""")!.AsObject();
var settings = HttpRequestSettings.Default;
using var message = new HttpRequestMessage(HttpMethod.Post, HttpRequestBuilder.BuildUri("https://api.example.com", request, settings))
{
Content = HttpRequestBuilder.BuildContent(request, explicitBody: null),
};
HttpRequestBuilder.ApplyHeaders(message, new Dictionary<string, string>(), request, settings);
// Sign it. The static registry holds the schemes that need no token store or IHttpClientFactory.
var auth = JsonNode.Parse("""{ "type": "hawk", "authId": "id1", "authKey": "a-shared-key" }""")!.AsObject();
await AuthStrategyRegistry.CreateStatic().Get("hawk").ApplyAsync(message, auth, CancellationToken.None);
The token-based schemes take an IHttpClientFactory and a TokenCache. To share tokens across processes, give
them your own ISharedTokenStore. HttpThrottleRegistry spaces out calls to each host.
Targets .NET 8, 9 and 10. MIT licensed.
| Product | Versions 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. |
-
net10.0
- Microsoft.Extensions.Http (>= 10.0.12)
- SpanFlow.Expressions (>= 1.0.0)
-
net8.0
- Microsoft.Extensions.Http (>= 10.0.12)
- SpanFlow.Expressions (>= 1.0.0)
-
net9.0
- Microsoft.Extensions.Http (>= 10.0.12)
- SpanFlow.Expressions (>= 1.0.0)
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 |
|---|---|---|
| 1.0.0 | 94 | 11/9/2026 |