ENGLISH GUIDE
Native cURL and Postman Debugging Tutorial: Complete Guide to Raw HTTP Request Body Structure and Headers
Don't want to install any SDK? Avoid third-party package dependencies and manually construct standard RESTful POST requests—suitable for embedding in Go, PHP, Rust, or any other development language environment.
1. Single-Line cURL Terminal Quick Call Command
Paste and run directly in a Linux / Mac terminal:
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key=$GEMINI_API_KEY" -H 'Content-Type: application/json' -X POST -d '{
"contents": [{
"parts":[{"text": "Write a short poem praising the sunshine"}]
}]
}'
2. Core Structure Analysis
The request body consists of a contents array, which contains parts text objects. Because it uses pure standard HTTP protocol, you can integrate a large model in seconds using any old language that supports network requests—even C.
This English translation is based on a Chinese source article. Prices are approximate where stated and conditions should be confirmed with the official provider or seller.