parent
ead50742d5
commit
996d755f58
@ -1,15 +1,30 @@
|
|||||||
package org.pavlik.helpers;
|
import org.apache.http.HttpResponse;
|
||||||
|
import org.pavlik.helpers.RestHelper;
|
||||||
|
//package org.pavlik.helpers;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
RestHelper Rest = new RestHelper("client-keystore3.jks","JKS","123321","2","truststore.jks","JKS","123321");
|
RestHelper Rest = new RestHelper(
|
||||||
String cyrillicString = "какашка";
|
"client-keystore3.jks",
|
||||||
// try {
|
"JKS",
|
||||||
// cyrillicString = URLEncoder.encode(cyrillicString, "UTF-8");
|
"123321",
|
||||||
// } catch (UnsupportedEncodingException e) {
|
"2",
|
||||||
// throw new RuntimeException(e);
|
"truststore.jks",
|
||||||
// }
|
"JKS",
|
||||||
Rest.queryPostRaw("https://192.168.200.10/index.php?koko=1",cyrillicString);
|
"123321");
|
||||||
|
|
||||||
|
|
||||||
|
String queryUrl = "https://192.168.200.10/index.php?kokoko=1";
|
||||||
|
String queryBody = "{\"k\":\"val\"}";
|
||||||
|
HashMap<String,String> queryHeaders = new HashMap<>();
|
||||||
|
queryHeaders.put("CONTENT-TYPE","text/plain2; charset=UTF-8");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
HttpResponse resp = Rest.queryPostRaw(queryUrl,queryBody,queryHeaders);
|
||||||
|
String respBody = Rest.getRespBody(resp);
|
||||||
|
System.out.println(respBody);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in new issue