Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

My code is trying to stop a running Vm.Geeting Error Response {"badRequest": {"message": "Malformed request body", "code": 400}}

HttpPost request = new HttpPost(url); request.addHeader("Accept", "application/json"); request.setHeader("Content-Type", "application/json"); request.setHeader("X-Auth-Token",token); String request="{\"os-stop\": null}";

        StringEntity se = null;
        se=new StringEntity(gson.toJson(requestBody));
        request.setEntity(se);

        HttpResponse response=client.execute(request);