java.io.IOException:Connection上意外的流结束

时间:2018-05-02 13:00:56

标签: android kotlin retrofit okhttp3

我通过改造来解决这个问题,但是对于邮递员来说,它工作正常。

  

java.io.IOException:意外的流结束   连接{2.test.esb.demoapp.com:80,proxy = DIRECT   hostAddress = 2.test.esb.demoapp.com / 172.16.33.156:80 cipherSuite = none   协议= HTTP / 1.1}

使用以下方法调用改装api:

override fun registerDevice(deviceType: String, deviceId: String, deviceToken: String, description: String): Flowable<DefaultResponse> {

    val paramObject = JSONObject()
    paramObject.put("deviceType","2")
    paramObject.put("deviceId","45334343434dsdsdfgvxfg")
    paramObject.put("deviceToken","fgfdsd3443434sdsdsd")
    paramObject.put("description","Test")


    var deviceRegisterSuccess = demoService.registerNewDevice(paramObject)
    return deviceRegisterSuccess;

}

DemoService.kt

interface DemoService {

@POST("/v1/device/register")
@Headers("Content-Type: application/json")
fun registerNewDevice(@Body request: JSONObject) : Flowable<DefaultResponse>

}

0 个答案:

没有答案