Skip to content Skip to sidebar Skip to footer

Android Retrofit Causes Socket Timeout Exception

I am making a POST call to a tomcat server running Struts2 using the retrofit library on an Android Galaxy S3 (/Nexus 7) device. The POST call fails. The tomcat log shows Socket ti

Solution 1:

Adding Square's OKHTTP library into the libs folder fixed the issue.

Solution 2:

I was having SocketTimeoutExceptions too. Pay attention to always add the final slash to your POST call.

Example:

BAD

@POST("/customers")

GOOD

@POST("/customers/")

My mistake was just this :)

Post a Comment for "Android Retrofit Causes Socket Timeout Exception"