Skip to main content

api_request

Function api_request 

Source
pub async fn api_request(
    api_url: &str,
    method: Method,
    path: &str,
    token: Option<&str>,
    body: Option<Value>,
    query: &[(String, String)],
    extra_headers: &[(String, String)],
    raw: bool,
    include: bool,
) -> i32
Expand description

Execute an authenticated API request, print response, exit with structured code.

Exit codes: 0=success (2xx), 1=client error (4xx), 2=server error (5xx), 3=connection error, 4=usage error