Qore RestClientDataProvider Module Reference 2.2.0
Loading...
Searching...
No Matches

Introduction to the RestClientDataProvider Module

The RestClientDataProvider module provides a data provider API for REST servers through the dataproviderintro "DataProvider" API.

The following classes are provided by this module:

Debug Info Collection

REST data providers support debug info collection for capturing technical details about HTTP requests and responses. This is useful for debugging API interactions.

Example: Capturing REST Debug Info
%requires RestClientDataProvider
# Create a REST data provider
RestClientDataProvider provider("https://api.example.com");
# Enable debug collection
BufferedDebugInfoCollector collector();
provider.setDebugCollector(collector);
# Make REST calls
auto result = provider.getChildProvider("users").doRequest({"method": "GET"});
# Analyze debug info
list<hash<DataProviderDebugInfo>> info = collector.getAll();
foreach hash<DataProviderDebugInfo> debug in (info) {
printf("%s %s\n", debug.method, debug.url);
printf(" Status: %d %s\n", debug.status_code, debug.status_message);
printf(" Duration: %dms\n", debug.duration_ms);
printf(" Protocol: %s\n", debug.protocol);
if (debug.request_headers) {
printf(" Request Headers: %y\n", debug.request_headers);
}
}

See Debugging Data Providers in the DataProvider module for more information.

Release Notes

RestClientDataProvider v2.2

  • added debug info collection support via AbstractDataProvider::setDebugCollector()
  • debug info includes HTTP method, URL, headers, request/response bodies, status codes, timing, and protocol info

RestClientDataProvider v2.0.1

RestClientDataProvider v2.0

  • added support for the data provider action catalog API (issue 4808)

RestClientDataProvider v1.1

  • implemented the swagger_lax_parsing option to try to parse invalid Swagger schemas (issue 4741)

RestClientDataProvider v1.0.1

  • added support for the pre_encoded_urls option (issue 4656)

RestClientDataProvider v1.0

  • initial release of the module