0
我使用一个按钮创建一个简单的SWT应用程序。当按钮被点击时,下面的代码被执行,但它只是挂起。我知道网址是好的!任何想法可能会导致这一点?Java HTTP示例代码挂起
HttpGet httpGetRequest = new HttpGet(URL_UUID);
// Execute HTTP request
HttpResponse httpResponse = httpClient.execute(httpGetRequest);
System.out.println("----------------------------------------");
System.out.println(httpResponse.getStatusLine());
System.out.println("----------------------------------------");
我如何用户的http请求? – Jon
将依赖关系添加到pom.xml或build.gradle [MVNRepository](https://mvnrepository.com/artifact/com.jsunsoft.http/http-request/0.0.5) –
挂在HttpClient上httpClient = HttpClients.createDefault() ; – Jon