SaveSnippets
Community
Pricing
Sign In
Get Started
Community
Public Snippets
9
Code shared by the SaveSnippets community — browse, copy, and get inspired.
All Languages
Bash
Go
HTML
Java
JavaScript
Kotlin
PHP
Python
Rust
SQL
TypeScript
#curl
Clear
Tags
#php
#kotlin
#bash
#go
#sql
#rust
#typescript
#html
#java
#python
#files
#utils
#strings
#http
#concurrency
#async
#json
#arrays
#security
#types
#crypto
#database
#dates
#format
Bash
Pretty-Print JSON from cURL
Pipe API responses through jq for syntax-colored, indented output. Also great for extracting specific fields without writing a parser.
#bash
#http
#curl
#json
#jq
PHP
cURL POST JSON
Post a JSON body with the right Content-Type header and parse the response. Returns the decoded body or throws on a non-2xx response.
#php
#http
#curl
#json
#post
Bash
Multipart File Upload via cURL
Upload one or more files using -F. Optional extra form fields go through the same flag — quote carefully to preserve spaces.
#bash
#http
#curl
#upload
#multipart
PHP
cURL Multipart File Upload
Upload one or more files via multipart/form-data using cURL's CURLFile abstraction. No manual boundary or body construction needed.
#php
#http
#curl
#upload
#multipart
Bash
Check URL Returns 200
Quick health-check helper: returns 0 if a URL responds with a 2xx status, non-zero otherwise. Use in pre-deploy smoke tests.
#bash
#http
#curl
#health-check
Bash
Download with Progress Bar
Show a progress bar for long downloads. wget gives a great built-in bar; curl needs an explicit flag.
#bash
#http
#download
#progress
#curl
PHP
Simple cURL GET with Timeout
A no-dependency HTTP GET helper with sensible defaults: short timeout, follow redirects, return body as string, throw on transport error. Pass extra headers as a simple associative array.
#php
#http
#curl
#get
Bash
Get Public IP Address
Several free services return your public IP as plain text. Useful when scripts running behind NAT need to know what address the outside world sees.
#bash
#network
#ip
#curl
Bash
cURL GET with Timeout + Retry
A sensible default cURL invocation: short connect timeout, total timeout, retry on transient failures with backoff, fail-on-error.
#bash
#http
#curl
#retry
#timeout