Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
EBT_HTTPRequest.c
Go to the documentation of this file.
1
class
EBT_HTTPErrorResponse:
JsonApiStruct
2
{
3
string
error;
4
5
//---------------------------------------------------------------------
6
void
EBT_HTTPErrorResponse
()
7
{
8
RegV(
"error"
);
9
}
10
}
11
12
class
EBT_HTTPRequest
13
{
14
//---------------------------------------------------------------------
15
static
void
DefaultOnError
(
RestCallback
cb)
16
{
17
int
code = cb.GetHttpCode();
18
string
data
= cb.GetData();
19
20
EBT_HTTPErrorResponse
eResponse =
new
EBT_HTTPErrorResponse
();
21
22
eResponse.ExpandFromRAW(
data
);
23
PrintFormat
(
string
.Format(
"EBT HTTP Request ERROR: %1"
, eResponse.error),
LogLevel
.ERROR);
24
25
}
26
27
//---------------------------------------------------------------------
28
static
void
Send(
string
method,
string
endpoint,
string
payload, notnull RestCallback callback)
29
{
30
RestApi api =
GetGame
().GetRestApi();
31
RestContext ctx = api.GetContext(
"http://localhost:8080/"
);
32
33
if
(method ==
"POST"
)
34
ctx.POST(callback, endpoint, payload);
35
else
if
(method ==
"GET"
)
36
ctx.GET(callback, endpoint);
37
else
38
PrintFormat
(
"Unsupported HTTP method: %1"
, method);
39
}
40
}
EBT_HTTPErrorResponse
void EBT_HTTPErrorResponse()
Definition
EBT_HTTPRequest.c:19
DefaultOnError
EBT_HTTPErrorResponse JsonApiStruct DefaultOnError(RestCallback cb)
Definition
EBT_HTTPRequest.c:15
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
data
Get all prefabs that have the spawner data
Definition
SCR_EntityCatalogManagerComponent.c:320
EBT_HTTPErrorResponse
Definition
EBT_HTTPRequest.c:2
JsonApiStruct
base classes for filtering in server browser
Definition
SCR_FeedbackDialogUI.c:3
RestCallback
Definition
RestCallback.c:72
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
PrintFormat
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)
scripts
WorkbenchGameCommon
EnfusionBlenderTools
EBT_HTTPRequest.c
Generated by
1.17.0