menu_bookDocumentation

HTTP Requests: Async GET, POST, and JSON with the Static Http Class

calendar_today May 20, 2026 schedule ~1 min read person PatrickJr verified 50

s&box provides a static Http class for creating asynchronous HTTP requests (GET, POST, DELETE, etc.) with JSON content and response parsing.

URL Restrictions

Only http or https URLs to domains are allowed (no IP addresses). localhost is permitted only on ports 80/443/8080/8443. Use the -allowlocalhttp command line switch to access any local URL from the server.

Common Usage

CSHARP
// GET request returning response as string
string response = await Http.RequestStringAsync( "https://google.com" );

// POST request with JSON content, ignoring response
await Http.RequestAsync( "https://api.facepunch.com/my/method", "POST", Http.CreateJsonContent( playerData ) );

The Http class handles serialization and deserialization of JSON automatically via Http.CreateJsonContent(). All requests are asynchronous and should be awaited in async methods or fired with _ = Http.RequestAsync(...) from synchronous code.

Was this helpful?