這是create方法的源碼:public static RequestBody create(MediaType contentType, String content) { Charset charset = Util.UTF_8; if (contentType != null) { charset = contentType.charset(); if (charset == null) { charset = Util.UTF_8; contentType = MediaType.parse(contentType + "; charset=utf-8"); } } byte[] bytes = content.getBytes(charset); return create(contentType, bytes); }這個content是類似于“a=88&b=99”這樣的字符串嗎?
2 回答

三國紛爭
TA貢獻(xiàn)1804條經(jīng)驗(yàn) 獲得超7個贊
推薦你使用 postman ,這個是 chrome 的一款http調(diào)試的插件,他可以直接生成okhttp 的代碼。
這是我自己調(diào)試時用 postman生成的okhttp 的java代碼。
添加回答
舉報
0/150
提交
取消