user1581164
user1581164

Reputation: 81

Send JSONObject from android app to node.js over http?

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

Answers (1)

rdrey
rdrey

Reputation: 9529

  1. OK, start by learning about HTTP & REST to decide whether you want to PUT or POST your JSON.

  2. Create a HTTPRequest in your Android app that puts the JSON into the HTTP message's body. See:

Back to node:

  1. 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.

  2. Use a body parser in express to read the JSON object.

  3. $$$ PROFIT $$$

Upvotes: 4

Related Questions