
top.javatool.payment.converter.FastJsonRequestBodyConverter Maven / Gradle / Ivy
package top.javatool.payment.converter;
import com.alibaba.fastjson.JSON;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import retrofit2.Converter;
import java.io.IOException;
/**
*
* Created by apple on 2017/4/9.
*/
public class FastJsonRequestBodyConverter implements Converter {
private static final MediaType MEDIA_TYPE = MediaType.parse("application/json; charset=UTF-8");
@Override
public RequestBody convert(T value) throws IOException {
return RequestBody.create(MEDIA_TYPE, JSON.toJSONBytes(value));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy