public String getCSMVASTAdResponse() { JSONObject tag = new JSONObject(); JSONArray ads = new JSONArray(); try { tag.put("uuid", getUuid()); tag.put("auction_id",getAuction_id()); tag.put("tag_id",getTag_id()); tag.put("timeout_ms",getTimeout_ms()); ads.put(getAdJSONContent()); tag.put("ads",ads); String escapedJSON = ""; try { escapedJSON= URLEncoder.encode(tag.toString(), "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return escapedJSON; } catch (JSONException e) { e.printStackTrace(); } return null; } }