I have a JSONArray that I am creating by iterating through a database using the cursor(Java). The JASONArray I am creating looks like this:
[{"transID":"1001","shiftID":"1","transType":"test","transDateTime":"2013-02-22 15:30:374:021"},
"transID":"1002","shiftID":"2","transType":"ghy","transDateTime":"2013-02-25 11:56:926:020"},
"transID":"1003","shiftID":"3","transType":"ghfm","transDateTime":"2013-02-25 11:56:248:026"}]
I am trying to post the JSONArray above to a RESTful service. I have the URL, UserID and Token, I am having a hard time understanding how to create HTTP post and have looked at the following links:
How to send a JSONObject to a REST service?
Posting a File and Associated Data to a RESTful WebService preferably as JSON
Posting a JSONArray to WCF Service from android
I understand how the first link worked, but I am unclear on how I should implement the userID and token before posting to the REST service.
This is new to me and if anyone could lead me in the right direction it would be appreciated.
Thank you in advance.