gadgets.io.makeNonProxiedRequestを使用したとき、引数であるmakeRequestParamsのPOST_DATAに記載した値は以下のメソッドで取得できます。
public String getPayload(RunData rundata) {
StringBuilder str = new StringBuilder();
ServletInputStream in = null;
BufferedReader r = null;
try {
in = rundata.getRequest().getInputStream();
r = new BufferedReader(new InputStreamReader(in));
String sLine;
while ((sLine = r.readLine()) != null) {
str.append(sLine);
}
} catch (IOException e) {
} finally {
if (r != null) {
try {
r.close();
} catch (IOException e) {
// ignore
}
}
if (in != null) {
try {
in.close();
} catch (IOException e) {
// ignore
}
}
}
return str.toString();
}
返り値はStringですが、以下の方法でjsonObjectにすることでデータを扱いやすくなります。
JSONObject jsonObject = JSONObject.fromObject(str);


