Quote:
Originally Posted by DJ Tsunami
You are missing http:// in your URL.
|
I don't think this is the issue as I specified the port in the url
Quote:
Originally Posted by DJ Tsunami
I would also check your sourcemod/logs folder for errors.
|
Nothing looks like linked to my issue (only info from maps etc)
Anyway, the extension is loaded correctly.
The plugin is listed loaded in the plugins list from sm too.
When I reload it I got prints next to the httpClient.`methode`("blabla", callBack)
But, I got no prints in the callback, even with this example :
I literally recreate a new plugin with the exact same code as your example (with just one more print) :
PHP Code:
#include <sourcemod>
#include <ripext>
HTTPClient httpClient;
public void OnPluginStart()
{
httpClient = new HTTPClient("https://jsonplaceholder.typicode.com");
httpClient.Get("todos/1", OnTodoReceived);
}
void OnTodoReceived(HTTPResponse response, any value)
{
PrintToServer("test please print");
if (response.Status != HTTPStatus_OK) {
// Failed to retrieve todo
return;
}
// Indicate that the response is a JSON object
JSONObject todo = view_as<JSONObject>(response.Data);
char todoTitle[256];
todo.GetString("title", todoTitle, sizeof(todoTitle));
PrintToServer("Retrieved todo with title '%s'", todoTitle);
}
It's loaded correctly, and when I (re)load it, I still have no print from the callback