Created by: Swordsman-Inaction
Server currently cannot handle Json Array
body. Because Json Array
and Json Object
share the same content-type
, It's not possible to differentiate them in HttpUtil
before the actual value is read.
So I removed JSONArrayBody
(It's not used at all) and JSONObjectBody
, then add new JSONTypeBody
which supports both types.
Before:
Get Json Object
: json = ((JSONObjectBody)request.getBody()).get();
Get Json Array
: No way
After:
Get Json Object
: json = ((JSONTypeBody) request.getBody()).getJsonObject();
Get Json Array
: json = ((JSONTypeBody) request.getBody()). getJsonArray();
Warning: It's a BREAK change, do not merge it if you think it's not good enough.
Another thing, the link https://koush.clockworkmod.com/test/echo
used in unit test doesn't work now, can you fix it?