代码拉取完成,页面将自动刷新
形如以下代码:
OkHttps.sync("http://xxxxx")
.bodyType(OkHttps.JSON)
.post();
期望发出的 Content-Type
是 application/json
,但实际发出的却是 application/x-www-form-urlencoded
即:
所有应该有报文体,但没有添加 bodyPara 的请求,都会默认以空表单的形式提交。
当前的可行的避免方案有:
OkHttps.sync("http://xxxxx")
.bodyType(OkHttps.JSON)
.addBodyPara(null) // 添加一个 空 报文体参数
.post();