• 大小: 2.12M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签: rest  demo  

资源简介

Server开放RESTful API接口,供应用程序/移动App/嵌入式qt通过http post调用,实现获取服务端数据,更新服务器数据


资源截图

代码片段和文件信息

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;

import encryption.SecurityHelper;
import net.sf.json.JSONArray;
import net.sf.json.JSONobject;

public class CRestDAO {

private static class RestStoreHolder {
        static CRestDAO instance = new CRestDAO();
    }

    public static CRestDAO getInstance() {
        return RestStoreHolder.instance;
    }
    
    private String strUrl = ““;
    
    public void SetUrl(String url)
    {
     strUrl = url;
    }
    
    PostResult HttpPost(String method String strcontent) {
        
     PostResult ret = new PostResult();
    
     String jsonBack = ““;
        
        try {

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-08-31 16:57  RestClient_Java\
     文件         699  2018-08-31 17:03  RestClient_Java\.classpath
     文件         391  2018-08-31 15:47  RestClient_Java\.project
     目录           0  2018-08-31 16:57  RestClient_Java\.settings\
     文件         598  2018-08-31 15:47  RestClient_Java\.settings\org.eclipse.jdt.core.prefs
     目录           0  2018-08-31 19:48  RestClient_Java\bin\
     文件         459  2018-08-31 19:48  RestClient_Java\bin\CRestDAO$RestStoreHolder.class
     文件        4675  2018-08-31 19:48  RestClient_Java\bin\CRestDAO.class
     目录           0  2018-08-31 19:48  RestClient_Java\bin\encryption\
     文件        3748  2018-08-31 19:48  RestClient_Java\bin\encryption\base64.class
     文件        2376  2018-08-31 19:48  RestClient_Java\bin\encryption\SecurityHelper.class
     文件         492  2018-08-31 19:48  RestClient_Java\bin\PostResult.class
     文件        2587  2018-08-31 19:49  RestClient_Java\bin\Program.class
     目录           0  2018-08-31 16:57  RestClient_Java\jar\
     文件      232019  2010-03-24 17:13  RestClient_Java\jar\commons-beanutils-1.8.3.jar
     文件      575389  2008-04-11 15:38  RestClient_Java\jar\commons-collections-3.2.1.jar
     文件      279193  2010-02-21 23:38  RestClient_Java\jar\commons-lang-2.5.jar
     文件       60841  2007-11-22 00:28  RestClient_Java\jar\commons-logging-1.1.1.jar
     文件       86487  2010-10-18 20:50  RestClient_Java\jar\ezmorph-1.0.6.jar
     文件      151839  2010-10-18 20:27  RestClient_Java\jar\json-lib-2.3-jdk15.jar
     目录           0  2018-08-31 16:57  RestClient_Java\src\
     文件        3930  2018-08-31 16:57  RestClient_Java\src\CRestDAO.java
     目录           0  2018-08-31 16:57  RestClient_Java\src\encryption\
     文件        3587  2018-08-31 16:00  RestClient_Java\src\encryption\base64.java
     文件        2164  2018-08-31 16:00  RestClient_Java\src\encryption\SecurityHelper.java
     文件         222  2018-08-31 16:56  RestClient_Java\src\PostResult.java
     文件        2040  2018-08-31 19:49  RestClient_Java\src\Program.java
     目录           0  2018-08-31 11:36  RestDemo\
     目录           0  2018-08-31 11:24  RestDemo\.vs\
     目录           0  2018-08-31 11:24  RestDemo\.vs\Solution1\
     目录           0  2018-08-31 11:24  RestDemo\.vs\Solution1\v15\
............此处省略90个文件信息

评论

共有 条评论