I m trying to implement the code under "Asynchronous Exchanges" from this link in the jetty documentation: http://wiki.eclipse.org/Jetty/Tutorial/HttpClient#Asynchronous_Exchanges
HttpExchange exchange = new HttpExchange();
// Optionally set the HTTP method
exchange.setMethod("POST");
exchange.setAddress(new Address("ping.host.com", 80));
exchange.setURI("/ping");
// Or, equivalently, this:
exchange.setURL("http://ping.host.com/ping");
client.send(exchange);
System.out.println("Exchange sent");
我正试图弄清楚正在使用哪个HttpExchange类。我从这里下载了jettyhttp://download.eclipse.org/jetty/
但是在文件中找不到对HttpExchange的引用。它可能是来自com.sun.net.httpserver的HttpExchange吗?当我尝试使用sun的构造函数时,我收到一个错误,告诉我该类没有HttpExchange()构造函数(没有参数)。