com.cmonbaby.http.converter.FastJsonRequestBodyConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http_lower Show documentation
Show all versions of http_lower Show documentation
Android Http Core Library
package com.cmonbaby.http.converter;
import androidx.annotation.NonNull;
import com.alibaba.fastjson.JSON;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import retrofit2.Converter;
/**
* Author: Simon
*
QO: 8950764
*
Email: [email protected]
*
WebSize: https://www.cmonbaby.com
*
Version: 1.0.0
*
Date: 2020/12/28
*
Description: 请求体
*/
final class FastJsonRequestBodyConverter implements Converter {
private static final MediaType MEDIA_TYPE = MediaType.parse("application/json; charset=UTF-8");
@Override
public RequestBody convert(@NonNull T value) {
return RequestBody.create(MEDIA_TYPE, JSON.toJSONBytes(value));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy