Java.io.eofexception: End Of Input At Line 1 Column 1
Solution 1:
When you see
java.io.EOFException: End of input at line 1 column 1
it indicates a problem with parsing something. It's expecting some text to parse but it got End of File (EOF).
Then you said:
When I changed server to external (nothing else changed)
If this worked before, your problem is definitely not on your code and it is on the data you're retrieving. Your new server is either rejecting your requests or returning blank data. Try doing the same request manually (via postman or some other api client) and see what the response is. It'll very likely tell you where the error is.
Solution 2:
I had this error because the body of the answer was passing an empty text "", I solved it by passing it a body null since certain methods that depend on the value of the body are being used. And when having an empty value, the necessary check-ups are not made, instead with the null value of the body, the flow is conditioned by the nullity.
In the declaration I went on to define a null value by default fun response(httpCode: Int, body: String? = null): Response<T>
In the invocation I went from Request#response(200, "")
to Request#response(200)
According to the http code protocol, only 204 can allow the body to be null although this may vary depending on the particular service of the needs of one.
GL
Post a Comment for "Java.io.eofexception: End Of Input At Line 1 Column 1"