This commit is contained in:
20
TestSseEndpoint.java
Normal file
20
TestSseEndpoint.java
Normal file
@@ -0,0 +1,20 @@
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
|
||||
public class TestSseEndpoint {
|
||||
public static void main(String[] args) throws Exception {
|
||||
HttpClient client = HttpClient.newHttpClient();
|
||||
HttpRequest request = HttpRequest.newBuilder()
|
||||
.uri(URI.create("http://localhost:8086/mcp"))
|
||||
.header("Accept", "text/event-stream")
|
||||
.header("X-Tool-Server-API-Key", "test")
|
||||
.GET()
|
||||
.build();
|
||||
|
||||
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
System.out.println("STATUS: " + response.statusCode());
|
||||
System.out.println("BODY: " + response.body());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user