http-request
http-request copied to clipboard
post special json type
how to post json like this :
{
"app_id" : "0.1.10",
"channel_tag" : "production",
"device" : {
"snapshot" : "0.1.10",
"binary_version" : "0.1.10",
"platform" : "android"
}
}
???
HttpRequest request = HttpRequest.post("http://localhost/").header(HttpRequest.HEADER_CONTENT_TYPE, HttpRequest.CONTENT_TYPE_JSON).send("{\n" +
" \"app_id\" : \"0.1.10\",\n" +
" \"channel_tag\" : \"production\",\n" +
" \"device\" : {\n" +
" \"snapshot\" : \"0.1.10\",\n" +
" \"binary_version\" : \"0.1.10\",\n" +
" \"platform\" : \"android\"\n" +
" }\n" +
"\n" +
"}");
...however a method for HttpRequest.post(url).json(strJson) function would be nice