Skip to content
github-actions[bot] edited this page Apr 11, 2026 · 4 revisions

PawnREST Wiki

Official documentation for PawnREST: an open.mp/SA-MP component that provides inbound HTTP routes, outbound HTTP/WebSocket clients, and a node-based JSON API for Pawn scripts.

Documentation Index

Page Scope
Getting Started Install, bootstrap, and first working routes
API Reference Complete native/constant reference from PawnREST.inc
JSON Node Guide JSON lifecycle, ownership, and composition patterns
Outbound HTTP Guide Request client setup, callbacks, and failure handling
WebSocket Guide Text/JSON websocket client usage and lifecycle
Callbacks Callback signatures and runtime behavior
Use Cases Practical deployment patterns and integration ideas
Troubleshooting Deployment/runtime diagnostics and quick fixes

Capability Matrix

Capability Supported
Inbound HTTP file upload routes
Inbound custom REST endpoints
Outbound HTTP text/JSON requests
Outbound file uploads
Outbound websocket client (text/json)
Node-based JSON API
TLS/HTTPS and WSS (build-dependent)
WebSocket server mode

API Conventions

  1. Public native prefixes are REST_* (HTTP/core) and FILE_* (file/upload).
  2. JSON node API uses concise Json* and Respond* helpers.
  3. Outbound HTTP/websocket flows are asynchronous and callback-driven.
  4. Route authentication uses Authorization: Bearer <token>.
  5. Structured error codes use PAWNREST_ERR_*.
  6. REST_GetHeader lookup is case-insensitive; REST_GetQuery* reads query params from request URL target.

Architecture Summary

  1. Inbound layer: REST_Start + FILE_RegisterRoute / REST_RegisterAPIRoute.
  2. Data layer: request helpers (REST_GetRequest*) + node JSON API (Json*).
  3. Outbound layer: REST_CreateRequestClient, REST_Request*, REST_WebSocket*.
  4. Integration layer: callbacks for upload, request, and websocket events.

Clone this wiki locally