0
API GET呼び出しをテストしているJavaliteで単純なプログラムを実行すると問題が発生します。org.javalite.http.HttpException:失敗したURL: "https://google.in"
このメソッドは、URLを取得して応答コードを読み取ります。しかし、JavaLiteは例外として投げています:
org.javalite.http.HttpException: Failed URL: "https://google.in"
誰かがこの問題を理解するのに役立つでしょうか?
私のコードは次のとおりです。あなたがhttps://www.google.co.in/
に返しますリダイレクトをしようとしているURLを試してみてください
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());
}
}
例外を含めてください – ipolevoy