Skip to main content

request_json

Function request_json 

Source
pub async fn request_json(
    auth: &RequestAuth,
    method: &str,
    path: &str,
    body: Option<&Value>,
) -> Result<Value, VercelApiError>
Expand description

The same request, carrying a JSON body.

A separate entry point rather than a fifth argument on every read: only the write half sends a body, and every caller that does not should not have to say so. Both funnel into one sender, which is what keeps the write half inside the egress allowlist and pointed at the same base URL as the reads — the writes used to build their own client against a hard-coded api.vercel.com, which put them outside both.