Raised This Month: $30 Target: $400
 7% 

Solved I need a library to encode as JSON and HTTP POST, GET


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ghostdlr
Senior Member
Join Date: Aug 2010
Old 11-01-2022 , 13:22   I need a library to encode as JSON and HTTP POST, GET
Reply With Quote #1

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?

Last edited by ghostdlr; 11-26-2022 at 16:40.
ghostdlr is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-01-2022 , 18:40   Re: I need a library to encode as JSON and HTTP POST, GET
Reply With Quote #2

yes, use Curl/sockets to transfer data to a webpage and use latest amxx version to work with Json
__________________
@Jailbreak Main Mod v2.6.6 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
ghostdlr
Senior Member
Join Date: Aug 2010
Old 11-05-2022 , 06:46   Re: I need a library to encode as JSON and HTTP POST, GET
Reply With Quote #3

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.

Last edited by ghostdlr; 11-05-2022 at 06:47.
ghostdlr is offline
ghostdlr
Senior Member
Join Date: Aug 2010
Old 11-05-2022 , 06:59   Re: I need a library to encode as JSON and HTTP POST, GET
Reply With Quote #4

I found HTTP:X for HTTP POST. Is it the best option?
ghostdlr is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Upplands Väsby, Sweden
Old 11-05-2022 , 12:15   Re: I need a library to encode as JSON and HTTP POST, GET
Reply With Quote #5

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
__________________
Black Rose is offline
ghostdlr
Senior Member
Join Date: Aug 2010
Old 11-05-2022 , 15:20   Re: I need a library to encode as JSON and HTTP POST, GET
Reply With Quote #6

Quote:
Originally Posted by Black Rose View Post
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.
ghostdlr is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-05-2022 , 18:47   Re: I need a library to encode as JSON and HTTP POST, GET
Reply With Quote #7

Quote:
Originally Posted by ghostdlr View Post
Do I need amx 1.9 to compile this?

I'm getting some errors.
I was able to compile with 1.9.0.
__________________
fysiks is offline
ghostdlr
Senior Member
Join Date: Aug 2010
Old 11-05-2022 , 21:24   Re: I need a library to encode as JSON and HTTP POST, GET
Reply With Quote #8

Plugins compiled with 1.9.0 should work on 1.8.2 server, right?
ghostdlr is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-06-2022 , 04:32   Re: I need a library to encode as JSON and HTTP POST, GET
Reply With Quote #9

Quote:
Originally Posted by ghostdlr View Post
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.
__________________

Last edited by HamletEagle; 11-07-2022 at 11:48.
HamletEagle is offline
ghostdlr
Senior Member
Join Date: Aug 2010
Old 11-06-2022 , 05:52   Re: I need a library to encode as JSON and HTTP POST, GET
Reply With Quote #10

Quote:
Originally Posted by HamletEagle View Post
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?
ghostdlr is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:01.


Powered by vBulletin®
Copyright ©2000 - 2023, vBulletin Solutions, Inc.
Theme made by Freecode