用户工具

站点工具


base:java

Java访问,使用ServiceRequester访问接口

http请求

提交参数,body支持Map1)、String2)

  String post = ServiceRequester.post(String service, Object body)

上传文件

  String post(String service, Map<String, String> params, String name, File file)

json和xml请求

  JSONObject json = ServiceRequester.request(String service, JSONObject json)
  XMLObject xml = ServiceRequester.requeset(String service, XMLObject xml)

数据校验接口示例

validate.jsonvalidate.xml

String service="https://api.xlongwei.com/service/";
Map<String, String> params = StringUtil.params("type","chinese","value","中文");
JSONObject json=ServiceRequest.request(service+"validate.json", params);
//{"valid":true}
XMLObject xml=ServiceRequester.request(service+"validate.xml", params);
//<response><valid>true</valid></response>

ite-sdk

//sdk下载、搜索、示例
http://t.xlongwei.com/windows/ite-sdk-1.0.0.jar
http://nexus.xlongwei.com/index.html#nexus-search;quick~ite-sdk
http://svn.xlongwei.com/evergreen/trunk/ite-sdk/src/test/java/com/itecheast/ite/sdk/JsonTest.java
1) 可以使用StringUtil.params(name,value)准备参数
2) 支持JSONObject和XMLObject的toString()方法
base/java.txt · 最后更改: 2019/01/03 21:34 由 admin