PDA

View Full Version : Posting via HTTP methods?


yusufali
12-03-2014, 00:11
How would one be able to post data using steamtools?

Here is what i have so far


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

"http://someurl.php?var=3&var2=4"


But what is a more robust way of achieving this?

asherkin
12-03-2014, 05:53
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
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
from reading the steamtools.inc
so if I try something like this:


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?