Services
The Devprime platform offers a Services adapter that simplifies connecting to external APIs through RPC, HTTP, gRPC, GraphQL and supports automatic strategies for distributed systems such as Retry, Circuit-breaker, and resiliency.
This code example demonstrates how the Services Adapter simplifies access to external API’s using the Dp.Services.HTTP.DpGet
command, allowing you to access an API from another microservice based on the Devprime platform and bring the typed return.
|
|
Services Adapter and Related Commands Dp.Services.HTTP
The Services Adapter on the Devprime platform offers a series of commands involving Post, Get, Put, Delete, Download, and specialized implementations that include methods starting with “Dp”, such as the DpGet
method. In addition, these methods bring intelligent behaviors, such as a result class based on the interface DevPrime.Stack.Foundation.Application.IServicesResult
.
Dp.Services.HTTP | — |
---|---|
Get | Using in external urls |
Get(url) |
Enter the url as string |
Get(url,connection) |
Enter the url as a string and a connection |
Get(param) |
Include HTTPParameter |
Get<T>(url) |
Enter the url and a class for automatic conversion into <T> |
Get<T>(url,connection) |
Enter url, connection, and a class for automatic conversion to <T> |
Get<T>(param) |
HTTPParameter parameter and a class for automatic conversion to <T> |
Summary | You can use any <T> class in Get |
DpGet | Used in Devprime-based urls |
DpGet(url) |
Enter the url as string |
DpGet(url,connection) |
Enter the url as a string and a connection |
DpGet(param) |
Include HTTPParameter |
DpGet<T>(url) |
Enter the url and a class for automatic conversion into <T> |
DpGet<T>(url,connection) |
Enter url, connection, and a class for automatic conversion to <T> |
DpGet<T>(param) |
HTTPParameter parameter and a class for automatic conversion to <T> |
Summary | The <T> class used in DpGet requires an IServicesResult |
Explore implementation examples:
Last modified April 16, 2024 (2b35fcc8)