Zum Hauptinhalt springen

MakeHttpRequestNodeConfiguration

Namespace: Meshmakers.Octo.MeshAdapter.Nodes.Transform

Make a http request

public record MakeHttpRequestNodeConfiguration : TargetPathNodeConfiguration, INodeConfiguration, IEquatable<NodeConfiguration>, ITargetPathNodeConfiguration, IEquatable<TargetPathNodeConfiguration>, IEquatable<MakeHttpRequestNodeConfiguration>

Inheritance Object → NodeConfiguration → TargetPathNodeConfiguration → MakeHttpRequestNodeConfiguration
Implements INodeConfiguration, IEquatable<NodeConfiguration>, ITargetPathNodeConfiguration, IEquatable<TargetPathNodeConfiguration>, IEquatable<MakeHttpRequestNodeConfiguration>

Fields​

DefaultAuthHeaderName​

The MakeHttpRequestNodeConfiguration.AuthHeaderName an unset property resolves to.

public static string DefaultAuthHeaderName;

Properties​

Method​

the HTTP method to use for the request (values: GET, POST, PUT, DELETE)

public string Method { get; set; }

Property Value​

String

BodyPath​

The path to the body of the request

public string BodyPath { get; set; }

Property Value​

String

Body​

The body of the request as a string

public string Body { get; set; }

Property Value​

String

UrlPath​

the path to the URL of the request

public string UrlPath { get; set; }

Property Value​

String

Url​

The URL of the request

public string Url { get; set; }

Property Value​

String

PathParameters​

Path parameters to be replaced in the URL

public List<HttpPathParameter> PathParameters { get; set; }

Property Value​

List<HttpPathParameter>

HeaderParameters​

Header parameters to be included in the HTTP request

public List<HttpHeaderParameter> HeaderParameters { get; set; }

Property Value​

List<HttpHeaderParameter>

ApiConfiguration​

Name of a GlobalConfiguration entry providing the API base URL and key. When set, the request URL is a path relative to that base and the key is sent in MakeHttpRequestNodeConfiguration.AuthHeaderName.

public string ApiConfiguration { get; set; }

Property Value​

String

AuthHeaderName​

Header the key from MakeHttpRequestNodeConfiguration.ApiConfiguration is sent in. The key is inserted as it is; with the default header and no prefix it goes out scheme-less, which suits a target expecting a bare token.

public string AuthHeaderName { get; set; }

Property Value​

String

Remarks:

Redirects: the shared HTTP client follows them automatically, and .NET strips the Authorization header when one crosses to another origin but leaves other headers in place. A key sent under a custom name would therefore travel to the redirect target. The first request always goes to the configured host, so it takes a target answering a 30x that points elsewhere; for such a target, prefer the default header.

AuthHeaderValuePrefix​

Scheme prefix placed before the key, for example "Bearer ". Empty by default.

public string AuthHeaderValuePrefix { get; set; }

Property Value​

String

Retry​

Retry behaviour for transient failures: 5xx, 408, 429, network errors and timeouts. Absent means a single attempt.

public HttpRetryOptions Retry { get; set; }

Property Value​

HttpRetryOptions

Remarks:

A retry re-sends the request as it was. That is safe for a GET, and it is a decision for anything that changes state: a POST whose response was lost - a timeout, a dropped connection, a 502 from a proxy that had already forwarded it - may well have been carried out by the target, and the retry then carries it out again. Enable retries on a non-idempotent method only where the target tolerates a repeat, for instance because it deduplicates by a key the body carries.

Nullable on purpose. A definition carrying an explicit null overwrites a property initializer, so a non-nullable property with a default would hand the node a null it cannot see coming - the same shape of mistake that a null integer in a settings entry once caused. Read it through Retry ?? new HttpRetryOptions() at every use site.

TimeoutSeconds​

Timeout in seconds applied to each attempt. Unset leaves the HTTP client's own default in place; the client is shared, so its timeout is never changed.

public Nullable<int> TimeoutSeconds { get; set; }

Property Value​

Nullable<Int32>

Remarks:

It can only shorten an attempt, never lengthen one: the client's own timeout is process-wide and applies underneath, so a value above it never takes effect. A failure reports which of the two ended the attempt rather than assuming this one did.

OnHttpError​

How a failed request is answered. The default keeps the behaviour the node had before the option existed: the failure is logged and the following nodes are skipped, while the execution still succeeds. It governs runtime outcomes only - a configuration mistake always fails.

public HttpErrorHandling OnHttpError { get; set; }

Property Value​

HttpErrorHandling

BodyContentType​

The media type of the request body (values: application/json, application/x-www-form-urlencoded). For application/x-www-form-urlencoded the body must be a JSON object whose properties become the form fields.

public string BodyContentType { get; set; }

Property Value​

String

ResponseFormat​

How the response body is stored at the target path (values: Auto, Text, Base64). Auto stores JSON objects as JSON and everything else as text; Base64 stores the raw response bytes base64-encoded (for binary downloads such as PDFs).

public string ResponseFormat { get; set; }

Property Value​

String

ContentLengthTargetPath​

Optional path where the response content length in bytes is stored (before base64 encoding). Useful for feeding nodes that require a content length, e.g. CreateFileSystemUpdate.

public string ContentLengthTargetPath { get; set; }

Property Value​

String

Paging​

Collects every page of a paged endpoint into one flat array at the target path.

public HttpPagingOptions Paging { get; set; }

Property Value​

HttpPagingOptions

TargetPath​

public string TargetPath { get; set; }

Property Value​

String

TargetValueWriteMode​

public TargetValueWriteModes TargetValueWriteMode { get; set; }

Property Value​

TargetValueWriteModes

TargetValueKind​

public ValueKinds TargetValueKind { get; set; }

Property Value​

ValueKinds

DocumentMode​

public DocumentModes DocumentMode { get; set; }

Property Value​

DocumentModes

Description​

public string Description { get; set; }

Property Value​

String

Constructors​

MakeHttpRequestNodeConfiguration()​

Caution​

Constructors of types with required members are not supported in this version of your compiler.


public MakeHttpRequestNodeConfiguration()