Module curl

Module curl 

Source
Expand description

Curl-based HTTP utilities for fetching JSON and text content.

This module provides functions for executing curl commands and handling common error cases with user-friendly error messages.

§Security

  • Uses absolute paths for curl binary when available (defense-in-depth against PATH hijacking)
  • Redacts URL query parameters in debug logs to prevent potential secret leakage

Structs§

CurlResponse
Response metadata including headers for parsing Retry-After, ETag, and Last-Modified.

Functions§

curl_json
What: Fetch JSON from a URL using curl and parse into serde_json::Value.
curl_text
What: Fetch plain text from a URL using curl.
curl_text_with_args
What: Fetch plain text from a URL using curl with custom arguments.
curl_text_with_args_headers
What: Fetch plain text from a URL using curl with custom arguments, including headers.