Raised This Month: $51 Target: $400
 12% 

HTTP Get and Put


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
darkid
Member
Join Date: Sep 2014
Old 01-25-2015 , 22:22   HTTP Get and Put
Reply With Quote #1

I'm trying to write some code to interact with a database, but I can't figure out how to do HTTP REST requests. I've been suggested to use SteamWorks, but I don't know if that's the correct extension to use. I'm also not sure as to how to specify queries, like ?key=<keyname>.
I'm getting the response as JSON, and I'm not entirely sure how to parse that.
darkid is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 01-26-2015 , 05:57   Re: HTTP Get and Put
Reply With Quote #2

if by HTTP REST you actually mean HTTP POST then the data is sent in the end, and you have to specify the content-length of the data you are sending

something like this:
Code:
POST /page HTTP/1.1\r\n
Host: host.com\r\n
Content-Length: 9\r\n
\r\n
key=value\r\n
for parsing JSON you could try this include: https://forums.alliedmods.net/showthread.php?t=189772
jimaway is offline
darkid
Member
Join Date: Sep 2014
Old 01-26-2015 , 08:28   Re: HTTP Get and Put
Reply With Quote #3

What function would I call to send the POST request?
darkid is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 01-26-2015 , 08:52   Re: HTTP Get and Put
Reply With Quote #4

https://forums.alliedmods.net/showthread.php?t=151401

you could also check this include out https://forums.alliedmods.net/showthread.php?t=223898

Last edited by jimaway; 01-26-2015 at 08:56.
jimaway is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-26-2015 , 09:23   Re: HTTP Get and Put
Reply With Quote #5

Is HTTP your only option for this? Might be easier to create your own server and do a basic TCP\UDP transmission.
__________________
Bugsy is offline
Reply



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 09:57.


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