SaveSnippets
Community
Pricing
Sign In
Get Started
Community
Public Snippets
6
Code shared by the SaveSnippets community — browse, copy, and get inspired.
All Languages
Bash
Go
HTML
Java
JavaScript
Kotlin
PHP
Python
Rust
SQL
TypeScript
#post
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
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
Rust
reqwest POST JSON
Send a JSON body by calling `.json(&value)` — serde handles serialization. Read the response body or status code afterwards.
#rust
#http
#reqwest
#post
#json
Java
HttpClient — POST JSON
POST a JSON body with `HttpRequest.BodyPublishers.ofString` + the right Content-Type. Pair with Jackson / Gson to serialize objects to JSON.
#java
#http
#httpclient
#post
#json
TypeScript
JSON POST Helper
Companion to `http<T>` — POST a JSON body and parse a JSON response, both typed. Handles the boilerplate Content-Type header and JSON serialization.
#typescript
#fetch
#http
#json
#post
Go
HTTP POST JSON Body
Build a request with `http.NewRequestWithContext`, set headers, send via your client. The context plumbing is what lets callers cancel mid-request.
#go
#http
#client
#post
#json
Kotlin
Ktor Client — POST JSON with Serialization
Combine Ktor + kotlinx.serialization: register the JSON plugin, declare `@Serializable` data classes, the client (de)serializes automatically.
#kotlin
#ktor
#http
#post
#json