<PackageReference Include="Refit" Version="16.3.0" />

Refit.GeneratedRequestRunner

public static class GeneratedRequestRunner
Request body content creation for source-generated requests: JSON, JSON Lines, and URL-encoded forms.
namespace Refit { public static class GeneratedRequestRunner { public static HttpContent CreateStreamContent(Stream stream); public static HttpContent CompressBodyContent(HttpContent content, RefitSettings settings, RequestCompression compression, CompressionLevel level); public static HttpContent CreateBodyContent<[Nullable(2)] TBody>(RefitSettings settings, TBody body, BodySerializationMethod serializationMethod, bool streamBody); public static HttpContent CreateJsonLinesBodyContent<[Nullable(2)] TBody>(RefitSettings settings, TBody body); public static HttpContent CreateTypedJsonLinesBodyContent<[Nullable(2)] TElement>(RefitSettings settings, IEnumerable<TElement> body); public static HttpContent CreateAsyncJsonLinesBodyContent<[Nullable(2)] TElement>(RefitSettings settings, IAsyncEnumerable<TElement> body); public static HttpContent CreateUrlEncodedBodyContent<[Nullable(2)] [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] TBody>(RefitSettings settings, TBody body); public static HttpContent CreateUrlEncodedBodyContent<[Nullable(2)] [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] TBody>(RefitSettings settings, TBody body, FormField<TBody>[] fields); public static bool CanUnrollForm(object body); public static Uri BuildRelativeUri(HttpClient client, string relativePath, UrlResolutionMode urlResolution); public static Uri BuildRelativeUri(HttpClient client, string relativePath, UrlResolutionMode urlResolution, UriFormat queryUriFormat); public static string RequireAbsoluteUrl(object url); public static string BuildRequestPath(string relativePathTemplate, bool allowUnmatchedParameter, ReadOnlySpan<((int StartIdx, int EndIdx) Range, string Value)> uriParams); public static string BuildRequestPath<[Nullable(0)] T>(string relativePathTemplate, bool allowUnmatchedParameter, (int StartIdx, int EndIdx) range, T value) where T : ISpanFormattable; public static string BuildRequestPath<[Nullable(0)] T>(string relativePathTemplate, bool allowUnmatchedParameter, (int StartIdx, int EndIdx) range, T value, string format) where T : ISpanFormattable; public static string BuildRequestPath(string relativePathTemplate, bool allowUnmatchedParameter); public static string BuildRequestPath(string relativePathTemplate, bool allowUnmatchedParameter, ReadOnlySpan<((int StartIdx, int EndIdx) Range, string Value, bool PreEncoded)> uriParams); public static string RoundTripEscapePath(string value, RefitSettings settings, ICustomAttributeProvider attributeProvider, Type type); public static string FormatUrlParameter(RefitSettings settings, object value, ICustomAttributeProvider attributeProvider, Type type); public static bool UsesDefaultUrlParameterFormatting(RefitSettings settings); public static bool UsesDefaultFormUrlEncodedParameterFormatting(RefitSettings settings); public static bool UsesDefaultUrlParameterKeyFormatting(RefitSettings settings); public static string BuildQueryKey(RefitSettings settings, string clrName, string explicitName, string prefixSegment); public static string FormatInvariant<[Nullable(0)] T>(T value, string format) where T : IFormattable; public static void AddFormattedCollectionProperty(ref GeneratedQueryStringBuilder builder, RefitSettings settings, IEnumerable values, string key, CollectionFormat collectionFormat, bool preEncoded, (Type ElementProviderType, ICustomAttributeProvider JoinedProvider, Type JoinedType) formatting); public static void SetHeader(HttpRequestMessage request, string name, string value, bool validateHeaders); public static void AddHeaderCollection(HttpRequestMessage request, IDictionary<string, string> headers, bool validateHeaders); public static void AddConfiguredRequestOptions(HttpRequestMessage request, RefitSettings settings, Type interfaceType); public static void AddRequestProperty<[Nullable(2)] TValue>(HttpRequestMessage request, string key, TValue value); public static HttpContent SerializeMultipartPart<[Nullable(2)] T>(RefitSettings settings, T value, string fieldName); public static void SetRequestJsonTypeInfo<[Nullable(2)] T>(HttpRequestMessage request, JsonTypeInfo<T> typeInfo); public static HttpContent CreateBodyContent<[Nullable(2)] TBody>(RefitSettings settings, TBody body, JsonTypeInfo<TBody> typeInfo, BodySerializationMethod serializationMethod, bool streamBody); public static Task SendVoidAsync(HttpClient client, HttpRequestMessage request, RefitSettings settings, bool bufferBody, CancellationToken cancellationToken); public static Task<T> SendAsync<[Nullable(2)] T, [Nullable(2)] TBody>(HttpClient client, HttpRequestMessage request, RefitSettings settings, bool isApiResponse, bool shouldDisposeResponse, bool bufferBody, CancellationToken cancellationToken); public static IObservable<T> SendObservable<[Nullable(2)] T, [Nullable(2)] TBody>(HttpClient client, Func<HttpRequestMessage> requestFactory, RefitSettings settings, bool isApiResponse, bool shouldDisposeResponse, bool bufferBody, CancellationToken methodCancellationToken); public static IAsyncEnumerable<T> StreamAsync<[Nullable(2)] T>(HttpClient client, HttpRequestMessage request, RefitSettings settings, CancellationToken methodCancellationToken, CancellationToken cancellationToken = default(CancellationToken)); public static void SetRequestTimeout(HttpRequestMessage request, int timeoutMilliseconds); } }