RESTClient

Executing Requests

Execute() runs the configured request synchronously and returns the response as a string. Execute<T>() deserializes the response to a typed object. ExecuteAsync() and ExecuteAsync<T>() are the async variants. ExecuteAndChain() executes and returns the RESTClient instance for continued chaining - useful when a sequence of calls depends on prior results. GetExecutionResults() retrieves all results from all Execute calls in the current chain as a ResultCollection.

NOTE

All Execute variants accept an optional bool publishEvent parameter (default true). Set to false to suppress GPAL event publishing for this call - useful for high-frequency polling calls that would flood the event log.

Examples

GPAL Fluent: High-level fluent C# API

//Execute() is the most common call - it sends the HTTP request and returns the raw response body as a string. The StatusCode property on the client holds the HTTP status code after each Execute call.

// Execute and get string result

string result = GPAL.RestClient

.WithAPIBase("http://localhost:9222")

.WithEndpoint("/api/navigate")

.WithParameters(new { url = "https://example.com" })

.Execute();


// Execute typed result

var status = GPAL.RestClient

.WithAPIBase("http://localhost:9222")

.WithEndpoint("/api/status")

.Execute<BrowserStatus>();

💬 Ask GPAL