All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.wandersnail.common.http.converter.StringResponseConverter Maven / Gradle / Ivy

There is a newer version: 2.2.1
Show newest version
package cn.wandersnail.common.http.converter;

import java.io.IOException;

import cn.wandersnail.common.http.exception.ConvertException;
import okhttp3.ResponseBody;
import retrofit2.Converter;

/**
 * 响应体为字符串
 * 
 * date: 2019/8/23 15:18
 * author: zengfansheng
 */
public class StringResponseConverter implements Converter {
    @Override
    public String convert(ResponseBody value) throws IOException {
        if (value == null) {
            throw new ConvertException("ResponseBody is null");
        } else {
            return value.string();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy