AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   SteamTools (https://forums.alliedmods.net/forumdisplay.php?f=147)
-   -   Posting via HTTP methods? (https://forums.alliedmods.net/showthread.php?t=252454)

yusufali 12-03-2014 00:11

Posting via HTTP methods?
 
How would one be able to post data using steamtools?

Here is what i have so far

Code:

HTTPRequestHandle hndl = Steam_CreateHTTPRequest(HTTPMethod:HTTPMethod_POST, "http://someurl.php");
but how would i post data to the url? I know i can hard code it using
Code:

"http://someurl.php?var=3&var2=4"
But what is a more robust way of achieving this?

asherkin 12-03-2014 05:53

Re: Posting via HTTP methods?
 
There is no way to specify GET (in URL) params for a POST request with the SteamWorks interface.
Any API that requires a POST really should support including any GET params in with the request body.
You also don't need to re-tag the HTTPMethod.

Powerlord 12-03-2014 14:18

Re: Posting via HTTP methods?
 
Quote:

Originally Posted by asherkin (Post 2230712)
Any API that requires a POST really should support including any GET params in with the request body.
You also don't need to re-tag the HTTPMethod.

It's not required and could be security violation to do that depending on what the form does.

yusufali 12-03-2014 16:11

Re: Posting via HTTP methods?
 
from reading the steamtools.inc
so if I try something like this:

Code:

HTTPRequestHandle hPost = Steam_CreateHTTPRequest(HTTPMethod_POST, "http://someurl.php")
setHTTP_param( hPost, "action", "some value" )
Steam_SendHTTPRequest( hPost, callback )

this will not work as a correct way to post data to a url?


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

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