| 105 | } |
| 106 | |
| 107 | public static String ParamAddPocPost(String body) throws UnsupportedEncodingException { |
| 108 | if(body.contains("=") && !body.contains("{")){ |
| 109 | String body_total = ""; |
| 110 | String[] bodys_single = body.split("&"); |
| 111 | for(String body_single:bodys_single) { |
| 112 | String[] body_single_lists = body_single.split("="); |
| 113 | body_total = body_total + body_single_lists[0] + "=" + Getpoc(true) + "&" ; |
| 114 | } |
| 115 | body_total = body_total.substring(0,body_total.length()-1); |
| 116 | return body_total; |
| 117 | }else if(!body.contains("=") && body.endsWith("}") && body.startsWith("{")){ |
| 118 | JSONObject jsonObject = JSON.parseObject(body); |
| 119 | for (String key:jsonObject.keySet()) { |
| 120 | jsonObject.put(key, Getpoc(true)); |
| 121 | } |
| 122 | return jsonObject.toString(); |
| 123 | }else if( body.contains("=") && body.contains("={") && body.contains("&")){ |
| 124 | String body_total = ""; |
| 125 | String[] bodys_single = body.split("&"); |
| 126 | for(String body_single:bodys_single) { |
| 127 | if (body_single.contains("={")){ |
| 128 | String[] body_single_lists = body_single.split("="); |
| 129 | JSONObject jsonObject = JSON.parseObject(body_single_lists[1]); |
| 130 | for (String key:jsonObject.keySet()) { |
| 131 | jsonObject.put(key, Getpoc(true)); |
| 132 | } |
| 133 | body_total = body_total + body_single_lists[0] + "=" + jsonObject.toString() + "&"; |
| 134 | }else { |
| 135 | String[] body_single_lists = body_single.split("="); |
| 136 | body_total = body_total + body_single_lists[0] + "=" + Getpoc(true) + "&"; |
| 137 | } |
| 138 | } |
| 139 | body_total = body_total.substring(0,body_total.length()-1); |
| 140 | return body_total; |
| 141 | }else if( !body.contains("&") && body.contains("\":{")){ |
| 142 | JSONObject jsonObject = JSON.parseObject(body); |
| 143 | for (String key:jsonObject.keySet()) { |
| 144 | if (jsonObject.getString(key).startsWith("{") && jsonObject.getString(key).endsWith("}")){ |
| 145 | JSONObject jsonObject2 = JSON.parseObject(jsonObject.getString(key)); |
| 146 | for (String key2:jsonObject2.keySet()) |
| 147 | jsonObject2.put(key2,Getpoc(true)); |
| 148 | jsonObject.put(key,jsonObject2); |
| 149 | } else |
| 150 | jsonObject.put(key, Getpoc(true)); |
| 151 | } |
| 152 | return jsonObject.toString(); |
| 153 | }else{ |
| 154 | return body; |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | |
| 159 | public static String Getpoc(Boolean urlencode) throws UnsupportedEncodingException { |