curl方式调用
curl -X GET -H "Content-Type: application/x-www-form-urlencoded" "https://api.omniexplorer.info/v1/transaction/tx/e0e3749f4855c341b5139cdcbb4c6b492fcc09c49021b8b15462872b4ba69d1b"
http方式调用说明
GET /v1/transaction/tx/e0e3749f4855c341b5139cdcbb4c6b492fcc09c49021b8b15462872b4ba69d1b HTTP/1.1 Host: api.omniexplorer.info Content-Type: application/x-www-form-urlencoded
返回结果:
{ "amount": "6167.00000000", "block": 511660, "blockhash": "0000000000000000003f37e72e599fbdaa14396a2e9251e493f0d7d15b1fd915", "blocktime": 1520009505, "confirmations": 7499, "divisible": true, "fee": "0.00009124", "ismine": false, "positioninblock": 825, "propertyid": 31, "propertyname": "TetherUS", "referenceaddress": "3GyeFJmQynJWd8DeACm4cdEnZcckAtrfcN", "sendingaddress": "3D4r9ERiM3HSc4eC4EhcT31tXoSV96HsPg", "txid": "e0e3749f4855c341b5139cdcbb4c6b492fcc09c49021b8b15462872b4ba69d1b", "type": "Simple Send", "type_int": 0, "valid": true, "version": 0 }
使用JFinal HttpKit.get
returnJson = HttpKit.get(" https://api.omniexplorer.info/v1/transaction/tx/e0e3749f4855c341b5139cdcbb4c6b492fcc09c49021b8b15462872b4ba69d1b");
报错如下:
java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure at com.jfinal.kit.HttpKit.get(HttpKit.java:136) at com.jfinal.kit.HttpKit.get(HttpKit.java:150) at wallet.abcbtc.io.index.IndexController.text(IndexController.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.jfinal.aop.Invocation.invoke(Invocation.java:74)
根据报错更换过local_policy.jar与US_export_policy.jar,但都没有效果。
正确的调用方式是如何?
项目:JFinal
http 工具可大可小,jfinal 内部提供的 HttpKit 仅用于 jfinal 自身的某个小功能的辅助,并不是一个功能全面的 http 工具