POST JSON Data to Web Server

Monkey Forums/Monkey Programming/POST JSON Data to Web Server

c.k.(Posted 2013) [#1]
What is the easiest way to POST data to a web server?

For example, my provider wants this:

The request format for authenticate is
URL : https://api.gamebaas.com/user/authenticate
Method : POST  
QueryParam : apiKey=<apiKey>&timestamp=<UTC_FORMATED_TIME_STAMP>  
Accept : application/json  
Content-Type : application/json  
Body :  
{  
    "gamebaas": {  
        "user": {  
            "userName": "Nick",  
            "password": "********"  
        }  
    }  
}  


How do I get that sent off to that URL with that timestamp?


Shinkiro1(Posted 2013) [#2]
Look at the tcpstream module which comes with monkey.
It has an example how to connect to a server and send it data.

Also I recently used this tutorial because I needed it for school: http://net.tutsplus.com/tutorials/other/http-headers-for-dummies/


c.k.(Posted 2013) [#3]
Thanks, Shinkiro1. I'll check it out!


c.k.(Posted 2013) [#4]
Shinkiro1, that's some good info!

Unfortunately, it looks like monkey's tcpstream stuff is not fully cross-platform.

Thanks for the heads-up.