Exemplo n.º 1
0
        protected R Execute <R>(Func <String, String, String, Byte[], IDictionary <String, String>, Action <String, Status, BmobException>, R> request,
                                String url, String contentType, Byte[] postData, IDictionary <String, String> headers, BmobCallback <T> fCallback)
        {
            BmobDebug.T("\r\n\t请求的URL : " + url
                        + "\r\n\t交互对象(以请求的数据为准): " + JsonAdapter.JSON.ToRawString(receiver)
                        + "\r\n\t请求的数据: " + JsonAdapter.JSON.ToJsonString(receiver.Data));

            return(request.Invoke(url, receiver.Method, contentType, postData, headers, (resp, status, ex) =>
            {
                if (BmobDebug.Debug)
                {
                    BmobDebug.D("返回数据内容为: " + resp);
                }
                else
                {
                    var rp = resp.Length > 400 ? resp.Substring(0, 200) + " ... ... ... ... ... ... " + resp.Substring(resp.Length - 200) : resp;
                    BmobDebug.I("返回数据内容为: " + rp);
                }

                onPostExecute(resp, status, ex, fCallback);
            }));
        }