Quote:
Originally Posted by SpirT
|
For example like this:
PHP Code:
#include <sourcemod>
#include <system2>
public void OnPluginStart() {
System2HTTPRequest httpRequest = new System2HTTPRequest(HttpResponseCallback, "https://domain.com/index.php?content=somethinghere");
httpRequest.GET();
delete httpRequest;
}
void HttpResponseCallback(bool success, const char[] error, System2HTTPRequest request, System2HTTPResponse response, HTTPRequestMethod method) {
if (!success) {
PrintToServer("Error on request: %s", error);
return;
}
if (response.StatusCode != 200) {
PrintToServer("Error: Found invalid status code %d", response.StatusCode);
return;
}
char content[10];
response.GetContent(content, sizeof(content));
if (StrEqual("0", content)) {
PrintToServer("Content is 0");
} else if (StrEqual("1", content)) {
PrintToServer("Content is 1");
} else {
PrintToServer("Error: Found invalid content %s", content);
}
}
Quote:
Originally Posted by CarOL
the var: success in httprequest callback was always False
and the error message is "schannel: next InitializeSecurityContext failed: Unknown error (0x80092013)"
|
Should be fixed with 3.3.1
Quote:
Originally Posted by paviln1
PHP Code:
public int GetPlayerId() { System2HTTPRequest httpRequest = new System2HTTPRequest(HttpResponseCallback, "url"); httpRequest.SetHeader("Content-Type", "application/json"); httpRequest.SetHeader("X-API-Key", "1234"); }
public void HttpResponseCallback(bool success, const char[] error, System2HTTPRequest request, System2HTTPResponse response, HTTPRequestMethod method) { if (success) { char[] content = new char[response.ContentLength + 1]; response.GetContent(content, response.ContentLength + 1);
PrintToServer("Content of the response: %s", content); } }
The response gives authentication failed. Could u maybe give an example how to do it?
|
I need a bit more information about your system to give you an answer here. You never send the request?
Quote:
Originally Posted by ESL_Ikarus
[SM] Unable to load extension "system2.ext": bin/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /serverfiles/cstrike/addons/sourcemod/extensions/system2.ext.so)
|
Can you retry it with the newest version?
__________________