Search code examples
androidandroidhttpclientandroid-json

Does HttpPost only returns xml and not json?


I've been working on a project that sends data to the server and receives a return value of JSON data. Unfortunately when I try to use HttpPost it returns as xml and not JSON.

I was able to fix the problem by using HttpGet.

I am just curious if it is possible to return JSON data using HttpPost? Can anyone enlightened me? I've been Googling around for a while but still unable to find any answers to my question.

P.S. Please don't flag my question.


Solution

  • The problem is not your HttpPost or HttpGet, the key point here is your server. When it receives a POST it is programmed to return a XML-like string and if it gets a GET it will return a JSON-like string