每一次网络请求都是一个Request,Request是对url,method,header,body的封装,也是对Http协议中请求行,请求头,实体内容的封装 public final class Request { private final HttpUrl url; private final String method; private final Headers headers; private final RequestBody body; private final Object t
okHttp都已经出到3.2.0了,现在才开始要用到它,感觉自己好low~~ 根据平时自己的习惯,还是自己做一下封装,让代码撸起来更加顺畅一点! okhttp-3.2.0和okio-1.7.0就不多说 首先建一个OkHttpUtils的类 /** * HTTP通讯结构处理器 * */ public class OkHttpUtils { private static final byte[] LOCKER = new byte[0]; private static OkHttpUtils mIn
C#数据库连接池 MySql SqlServer 查阅了一天的资料来学习MySql数据库连接池,终于在一篇博文上找到了,自己也整理了一下,希望对大家有用处 1. 建立连接池 1 using MySql.Data.MySqlClient; 2 using System; 3 using System.Collections; 4 using System.Collections.Generic; 5 using System.Linq; 6 using System.Text; 7 using S