AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved I need a library to encode as JSON and HTTP POST, GET (https://forums.alliedmods.net/showthread.php?t=340197)

ghostdlr 11-01-2022 12:22

I need a library to encode as JSON and HTTP POST, GET
 
I'm writing a plugin and I want to send end game stats and other information to a web page (maybe REST API).

Is there a amxx library I can use for this?

Also, is there any way to encode the information as JSON?

Natsheh 11-01-2022 17:40

Re: I need a library to encode as JSON and HTTP POST, GET
 
yes, use Curl/sockets to transfer data to a webpage and use latest amxx version to work with Json

ghostdlr 11-05-2022 05:46

Re: I need a library to encode as JSON and HTTP POST, GET
 
Can you give me some examples or some tutorials to start with?
I could also use TCP/UDP to send information to a server I guess, if it's easier than HTTP + json.

ghostdlr 11-05-2022 05:59

Re: I need a library to encode as JSON and HTTP POST, GET
 
I found HTTP:X for HTTP POST. Is it the best option?

Black Rose 11-05-2022 11:15

Re: I need a library to encode as JSON and HTTP POST, GET
 
Curl is overall better though.

There are examples on github, one is even named "http_post_json.sma".
https://github.com/Next21Team/AmxxCu...r/amx_examples

ghostdlr 11-05-2022 14:20

Re: I need a library to encode as JSON and HTTP POST, GET
 
Quote:

Originally Posted by Black Rose (Post 2792197)
Curl is overall better though.

There are examples on github, one is even named "http_post_json.sma".
https://github.com/Next21Team/AmxxCu...r/amx_examples

Do I need amx 1.9 to compile this?

I'm getting some errors.

fysiks 11-05-2022 17:47

Re: I need a library to encode as JSON and HTTP POST, GET
 
Quote:

Originally Posted by ghostdlr (Post 2792200)
Do I need amx 1.9 to compile this?

I'm getting some errors.

I was able to compile with 1.9.0.

ghostdlr 11-05-2022 20:24

Re: I need a library to encode as JSON and HTTP POST, GET
 
Plugins compiled with 1.9.0 should work on 1.8.2 server, right?

HamletEagle 11-06-2022 03:32

Re: I need a library to encode as JSON and HTTP POST, GET
 
Quote:

Originally Posted by ghostdlr (Post 2792222)
Plugins compiled with 1.9.0 should work on 1.8.2 server, right?

No. Plugins compiled with 1.8.2 will work in 1.9 servers.

ghostdlr 11-06-2022 04:52

Re: I need a library to encode as JSON and HTTP POST, GET
 
Quote:

Originally Posted by HamletEagle (Post 2792233)
No. Plugins compiled with 1.8.2 will work in 1.9 servers.

So, if I want full compatibility with both 1.8.2 and 1.9, I need to compile plugins with 1.8.2 only?
So I cannot use the new libraries and stuff, right?


All times are GMT -4. The time now is 12:07.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.