HTTP REST

RESTful API request-response pattern. Client makes HTTP request, server responds. Supports GET, POST, PUT, DELETE methods.

GraphQL

GraphQL query or mutation

Webhook

Event-driven push notification. Server sends HTTP POST to your endpoint when events occur. One-way communication from server to client.

MQTT

MQTT publish message

JSON-RPC

JSON-RPC 2.0 request

CLI Command

Command-line interface command

Protocol Details

HTTP REST

Request-Response Pattern: Client makes HTTP request, server responds. Standard RESTful API with JSON bodies. Supports GET, POST, PUT, DELETE methods. Generates curl commands and raw HTTP request formats.

curl -X POST https://api.example.com/users \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "name": "User"}'

Webhook

Event-Driven Push Pattern: Server sends HTTP POST to your endpoint when events occur. One-way communication from server to client. Event-driven webhook payloads with event types and structured data. Includes headers and payload formatting for webhook delivery.

Webhook vs REST: While REST requires you to actively request data, webhooks push data to you automatically when events happen. Think of REST as "asking for updates" and webhooks as "receiving notifications."

curl -X POST https://webhook.example.com/events \
  -H "X-Webhook-Event: user.created" \
  -d '{"event": "user.created", "data": {...}}'

GraphQL

GraphQL queries and mutations with variable definitions. Translates operations into GraphQL syntax with proper type definitions.

mutation CreateUser($input: UserInput!) {
  createUser(input: $input) {
    id
    email
  }
}

MQTT

MQTT publish messages with topic structures derived from resource and operation. Includes QoS and retain flag configurations.

mosquitto_pub -h mqtt.example.com \
  -t "sensors/temperature" \
  -m '{"value": 22.5, "unit": "celsius"}'

JSON-RPC

JSON-RPC 2.0 formatted requests with method names and parameter objects. Follows the JSON-RPC specification for remote procedure calls.

{
  "jsonrpc": "2.0",
  "method": "createUser",
  "params": {"email": "user@example.com"},
  "id": 1
}

CLI Command

Command-line interface commands in a fictional `aetherctl` format. Demonstrates how the same operation would be expressed as a terminal command.

aetherctl user create --email "user@example.com" --name "User"