Reputation: 81
Im having issues finding tutorial for this subject. Do anyone have an good example. I want to send an JSONObject from a android app over http to node.js. Thanks
Upvotes: 4
Views: 4054
Reputation: 9529
OK, start by learning about HTTP & REST to decide whether you want to PUT or POST your JSON.
Create a HTTPRequest in your Android app that puts the JSON into the HTTP message's body. See:
Back to node:
Set up a node.js http handler for that type of request. I recommend using express, since it's easy and you'll find the most examples & support when using it.
Use a body parser in express to read the JSON object.
$$$ PROFIT $$$
Upvotes: 4