ServerClient Quick Reference

HTTP client for server-side requests to external APIs and services

Key Features Server-Side Usage: // Get the ServerClient API var ServerClient = js.getObject("/OpenForum/AddOn/ServerClient","ServerClient.sjs"); // Simple GET request var response = ServerClient.get("https://api.example.com/data"); // GET with headers var response = ServerClient.get("https://api.example.com/data", { "Authorization": "Bearer token123", "Accept": "application/json" }); // POST request with JSON data var response = ServerClient.post( "https://api.example.com/data", JSON.stringify({key: "value"}), {"Content-Type": "application/json"} ); // PUT request var response = ServerClient.put( "https://api.example.com/data/123", JSON.stringify({key: "updated value"}), {"Content-Type": "application/json"} ); // DELETE request var response = ServerClient.delete("https://api.example.com/data/123"); // Parse JSON response var jsonData = JSON.parse(response); Response Object { statusCode: 200, body: "response content", headers: { "content-type": "application/json" } } Configuration