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 command Dp.Services.HTTP.DpGet
allowing you to access an API from another microservice based on the Devprime platform and already bring the typed return.
|
|
Services Adapter and Related Commands Dp.Services.HTTP
The Services Adapter on the Devprime platform provides 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 an interface-based result class 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 in <T> |
Get<T>(url,connection) |
Enter url, connection, and a class for automatic conversion in <T> |
Get<T>(param) |
HTTPParameter parameter is a class for automatic conversion to <T> |
Summary | You can use any class <T> in Get |
DpGet | Used in urls based on Devprime |
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 in <T> |
DpGet<T>(url,connection) |
Enter url, connection, and a class for automatic conversion in <T> |
DpGet<T>(param) |
HTTPParameter parameter is a class for automatic conversion to <T> |
Summary | The class <T> used in DpGet requires an IServicesResult |
Explore implementation examples:
Last modified September 10, 2024 (6166aa4f)