/// <summary> /// 以POST方式提交数据。 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="body"></param> /// <param name="formData"></param> /// <returns></returns> public T Post <T>(string body, FormData formData = null) { var url = String.Format("{0}{1}", Url, formData == null ? "" : string.Format("?{0}", formData.Format())); return(Post <T>(url, body)); }
/// <summary> /// 请GET方式请求,将响应序列化为<paramref name="anonymous" />的结构 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="formData"></param> /// <param name="anonymous"></param> /// <returns></returns> public T GetAnonymous <T>(FormData formData, T anonymous) { return(Get <T>(formData)); }
/// <summary> /// 以GET方式请求,返回响应的字符中 /// </summary> /// <param name="formData"></param> /// <returns></returns> public string GetString(FormData formData) { return(GetString(Url, formData)); }
/// <summary> /// 发送Get请求 /// </summary> /// <param name="formData"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public T Get <T>(FormData formData) { return(Deserialize <T>(GetString(formData))); }