Skip to main content

client

Function client 

Source
pub const fn client(service: &'static str) -> Client
Expand description

Creates a Client for calling service.

Requests accept paths relative to the service’s base URL and automatically propagate the active trace and Request Context. This function is const so it can initialize a module-level static; the service URL is resolved on first use.

Like base_url, calling client records a static dependency on service, so pass the service name as a string literal and call client directly inside a service.

ⓘ
static ORDERS: encore::services::Client = encore::services::client("orders");