External Services
Overview
// Web Requests can only be made on the gameservers. Requests made on the client will fail.
if (!Game.IsServer()) return;
let getResult = HttpManager.GetAsync("https://jsonplaceholder.typicode.com/todos/1");
print(getResult.statusCode, getResult.data);
let postResult = HttpManager.PostAsync("https://jsonplaceholder.typicode.com/posts", json.encode({
title: 'foo',
body: 'bar',
}));
print(postResult.statusCode, postResult.data);
Supported Methods
GetAsync(url: string, headers: string): HttpResponse;
GetAsync(url: string): HttpResponse;
PatchAsync(url: string, data: string): HttpResponse;
PatchAsync(url: string, data: string, headers: string): HttpResponse;
PostAsync(url: string, data: string): HttpResponse;
PostAsync(url: string, data: string, headers: string): HttpResponse;
PutAsync(url: string, data: string): HttpResponse;
PutAsync(url: string, data: string, headers: string): HttpResponse;
PutAsync(options: RequestHelper, headers: string): HttpResponse;
DeleteAsync(url: string): HttpResponse;
DeleteAsync(url: string, headers: string): HttpResponse;Verifying GameServer HTTP Requests
Last updated