Last active
September 8, 2017 21:13
-
-
Save stigkj/fce1239ae09a3327b88bf134c77ef1d1 to your computer and use it in GitHub Desktop.
HEAD request timing out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import okhttp3.*; | |
import org.junit.Test; | |
import static org.junit.Assert.assertEquals; | |
import static org.junit.Assert.assertNull; | |
public class OkHttpBug { | |
@Test | |
public void test() throws Exception { | |
Request request = new Request.Builder() | |
.head() | |
.url("http://www.sunhotels.net/SunHotels.net/HotelInfo/hotelImage.aspx?full=1&id=528422") | |
.build(); | |
OkHttpClient client = new OkHttpClient(); | |
Call call = client.newCall(request); | |
Response response = call.execute(); | |
assertEquals(response.header("Content-Length"), "123"); | |
assertNull(response.body()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment