getAbs方法注意事項
- 參數(shù) url 絕對路徑必須包含 protocol(http, https 等), 否則會因為非法 url 拋出 crash
client
.getAbs("https://myserver.mycompany.com:4043/some-uri")
.send()
.onSuccess(res ->
System.out.println("Received response with status code" + res.statusCode()))
.onFailure(err ->
System.out.println("Something went wrong " + err.getMessage()));
get()方法的參數(shù)注意事項
host 參數(shù):必須不能包含 protocol,否則會出現(xiàn) Unable to resolve host 異常。
reletiveUrl :必須是 / 開頭,內(nèi)部不會自動拼接,否則會出現(xiàn)400 Bad Request 異常。
client
.get(443, "myserver.mycompany.com", "/some-uri")
.ssl(true)
.send()
.onSuccess(res ->
System.out.println("Received response with status code" + res.statusCode()))
.onFailure(err ->
System.out.println("Something went wrong " + err.getMessage()));