Search⌘ K
AI Features

An HTTP Request You Can Explain End to End

Explore how to explain and debug HTTP requests end to end within AI workflow automation. Understand the key parts—URL, method, headers, and JSON body—and their roles in routing, authentication, and data payloads. Learn best practices to reduce errors by separating these components clearly and applying them to support inbox triage workflows.

A triage step can fail even when the application does not raise a runtime error because the request uses an incorrect endpoint, method, header, or payload configuration. The server may still return a response, but that response may be an authentication error, an HTML page, or an unexpected payload because the request body was not sent or parsed as intended.

One concrete artifact is enough to start, because every LLM triage call uses the same container shape.

To make that container visible, we can start from a minimal curl style request with placeholders and then point to where the email text and the instructions live:

Shell
curl -s -X POST \
"https://generativelanguage.googleapis.com/v1beta/models/gemini-3.6-flash:generateContent" \
-H "x-goog-api-key: {{Gemini_API_Key}}" \
-H "Content-Type: application/json" \
-d '{
"systemInstruction": {
"parts": [{"text": "Return ONLY JSON with keys category, priority, next_action, needs_human."}]
},
"contents": [
{
"role": "user",
"parts": [{"text": "EMAIL_TEXT_START\nSubject: App will not load after update\nFrom: jordan@example.com\nBody: Hi, after updating this morning the app shows a blank screen.\nEMAIL_TEXT_END"}]
}
],
"generationConfig": {"temperature": 0.2}
}'

That block of text is one request, and reading it as a single thing is what makes it hard to debug. It is easier to see as three separate regions, each answering a different question: where the request goes, what the server needs to know before it will read it, and what it is actually being asked to do.

The curl request split into its method + URL, headers, and JSON body parts
The curl request split into its method + URL, headers, and JSON body parts

The request is split into four parts ...