在我正在测试 API GET 调用的 Javalite 中执行一个简单程序时,我遇到了一个问题。
该方法获取 URL 并读取响应代码。但是 JavaLite 抛出异常:
org.javalite.http.HttpException: Failed URL: "https://google.in"
有人可以帮我理解这个问题吗?
我的代码是:
package com.java.lite;
import org.javalite.http.Get;
import org.javalite.http.Http;
import org.testng.annotations.Test;
public class GetCallTest {
@Test
public void getCall() throws Exception {
System.out.println(ConfigPropertyFile.getPropertyValues()); //This line is executed
Get get = Http.get(ConfigPropertyFile.getPropertyValues()); //URL being call from another class where I defined a static method.
System.out.println("Response code" + get.responseCode());
System.out.println("Response message = `enter code here`" + get.responseMessage());
}
}