package com.glxp.mipsdl.util.http;


import com.glxp.mipsdl.res.ucloud.UBaseResponse;

public class UHttpUtils {


    public static UBaseResponse returnError() {
        UBaseResponse response = new UBaseResponse();
        response.setErrormsg("访问U8服务接口出错！");
        response.setStatus("falied");
        return response;
    }

    public static String formatResponse(String response) {

        response = response.replace("\\\"\\\\\\\\\\\"", "\"\"");
        response = response.replace("\\\"\\\\\\\"", "\"");
        response = response.replace("\\\\\\\"", "'");
//        response = response.replace("\\\"\\\\\\\"","");

        response = response.replace("}\\", "} ");
        response = response.replace("\\", "");
        response = response.replace("}\"", "}");
        response = response.replace("\"{", "{");
        response = response.replace("\n", "");
        response = response.replace(" ", "");
        return response;
    }

    public static String formatResponseN(String response) {
        response = response.replace("\\\"\\\\\\\"", "\"\"");
        response = response.replace("\\\\\\\"", "'");
        response = response.replace("\\", "");
        response = response.replace("}\"", "}");
        response = response.replace("\"{", "{");
        response = response.replace("\n", "");
        response = response.replace(" ", "");
        return response;
    }

}
