Okhttp3问题 Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

时间:2022-11-13 14:52:03

Content type ‘application/x-www-form-urlencoded;charset=UTF-8’ not supported。这种情况是缺少头部。需要添加UTF-8.

解决

       public static final MediaType FORM_CONTENT_TYPE
        = MediaType.parse("application/json;charset=utf-8");

完整:

Okhttp3问题 Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported