Retrieving data from the REST Server works well, but if I want to post an object it doesn\'t work:
public static void postJSONObject(int store_type, Favorite
Your C# is different than your Java, and not just in syntax.
Your C# sends an application/json
entity to the server via HTTP POST. I'll leave it up to HTTP purists as to whether that's appropriate use of POST (vs. PUT).
Your Java creates a form, with a field of jsonString
(whose value is the JSON), and sends an application/x-www-form-urlencoded
entity to the server containing that form.