clugg / sm-httpreq Goto Github PK
View Code? Open in Web Editor NEWProvides the ability to make simple HTTP requests via the socket extension in SourcePawn.
License: GNU General Public License v3.0
Provides the ability to make simple HTTP requests via the socket extension in SourcePawn.
License: GNU General Public License v3.0
Hello, I'm somewhat new to pawn and I'm trying to contact my api using the following code:
public void OnPluginStart()
{
RegAdminCmd("sm_api_register", Command_Register, ADMFLAG_SLAY);
}
public Action Command_Register(int client, int args)
{
PrintToServer("Requesting match ID from project nun");
HTTPRequest req = HTTPRequest("GET", "http://projectnun.azurewebsites.net/api/heartbeat/register", "OnRequestComplete");
req.debug = true;
req.headers.SetString("User-Agent", "HTTPRequests for SourceMod");
req.SendRequest();
}
public void OnRequestComplete(bool bSuccess, int iStatusCode, StringMap tHeaders, const char[] sBody, int iErrorType, int iErrorNum, any data)
{
PrintToServer("Received");
}
however it'll never receive anything, the last thing on the output console is :
sm_api_register
Requesting match ID from project nun
httpreq::HTTPRequest 0 socket connecting to projectnun.azurewebsites.net:80
and it stays still. Am I missing something or is it really a bug ?
Anyway thanks for your attention and congratulations on your work so far
Changing over to SSL by simply updating the URL to include https did not work.
Looking through you includes, and quite possibly do a pull request with the required code to do an SSL secure HTTP request.
If you can add this, would be great. Otherwise I'm sure I'll figure it out eventually.
If I'm missing something and this is supported, please let me know.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.