update
This commit is contained in:
parent
2992f4f408
commit
4f46de8d00
3330 changed files with 394553 additions and 76939 deletions
32
.config/Code/User/History/-2754a774/eLQ9.java
Normal file
32
.config/Code/User/History/-2754a774/eLQ9.java
Normal file
|
@ -0,0 +1,32 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.net.http.HttpResponse.BodyHandlers;
|
||||
import java.security.KeyStore;
|
||||
|
||||
|
||||
public class Main{
|
||||
public static void main(String[] args){
|
||||
|
||||
try{
|
||||
KeyStore keyStore = KeyStore.getInstance("PKCS12");
|
||||
keyStore.load(new FileInputStream("/client.p12"), "keystore7548".toCharArray());
|
||||
|
||||
|
||||
HttpClient client = HttpClient.newBuilder().build();
|
||||
|
||||
HttpRequest request = HttpRequest.newBuilder().uri(new URI("https://localhost:8000/greet")).build();
|
||||
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());
|
||||
System.out.println(response.statusCode());
|
||||
System.out.println(response.body());
|
||||
}
|
||||
catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue