POST JSON Data to Web Server
Monkey Forums/Monkey Programming/POST JSON Data to Web Server
| ||
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>×tamp=<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? |
| ||
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/ |
| ||
Thanks, Shinkiro1. I'll check it out! |
| ||
Shinkiro1, that's some good info! Unfortunately, it looks like monkey's tcpstream stuff is not fully cross-platform. Thanks for the heads-up. |