现在大多数都使用前后端分离开发模式,前端通过Ajax请求访问后台服务器,后台返回JSON数据供前端操作,这里编写一个统一返回数据模板类,方便日后操作 public class R extends HashMap<String, Object>{ public R(int code) { this.put("code", code); this.put("time", System.currentTimeMillis()); } public static
1.封装post方法发送 using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Runtime.Serialization.Json; using System.Security.Cryptography; using System.Text; using System.Web; public class WebPostM