Code Snippets

Category: Networking & HTTP

Loop SSH Across Hosts

Run the same command on a list of hosts with -o BatchMode for key-only auth.

Author: chris

curl GET with JSON Response

Pipe a JSON response through jq for clean extraction.

Author: chris

HTTP GET with requests

GET a URL with the requests library and raise on non-2xx.

Author: chris

Fetch API GET Request

Modern Fetch with async/await, response status check, and JSON parsing.

Author: chris

Send Email with mail() in PHP

Fire-and-forget mail via the built-in mail() — fine for low-volume.

Author: chris

cURL GET Request in PHP

Issue a GET request with libcurl wrappers and capture the body.

Author: chris

HTTP GET in Go

Make an HTTP GET with net/http and read the body.

Author: chris

HTTP GET with reqwest

Async HTTP GET with the popular reqwest crate and tokio runtime.

Author: chris

HTTP GET with Net::HTTP

Stdlib HTTP GET request using Net::HTTP and URI.

Author: chris