//package com.wechat.activerequests;
//
//import org.apache.commons.logging.LogFactory;
//
//import com.wechat.activerequests.requests.IActiveRequest;
//import com.wechat.activerequests.responses.BaseResponse;
//import com.wechat.common.utils.JacksonUtils;
//import com.wechat.common.utils.NetworkUtils;
//import com.wechat.service.WeiXinService;
//
//public class ActiveRequests {
//
//    /**
//     * 实际发送接口
//     */
//    public static BaseResponse send(IActiveRequest req) {
//    	
//        String url = req.getTargetUrl();
//        String payload = req.getPayload();
//        LogFactory.getLog(ActiveRequests.class).debug("Ready to send request to:" + url + "\n payload: "+ payload);
//        BaseResponse rsp;
//        if (payload == null) {
//            rsp = NetworkUtils.getRemoteResponseAsJsonMethodGET(url, req.getResponseType());
//        } else {
//            url = String.format("%s?access_token=%s", url, WeiXinService.getInstance().getAccessToken());
//            rsp = NetworkUtils.getRemoteResponseAsJsonWithStringPayload(url, payload, req.getResponseType());
//        }
//        LogFactory.getLog(ActiveRequests.class).debug("Responded: " + JacksonUtils.beautifulSerialize(rsp));
//        return rsp;
//    }
//}
