scalaj/scalaj-http — Issue #6: SocketTimeoutException with Http.param and Http.params
Author: ssanj
Created: 2012-01-19 06:47:27+00:00
State: open

Hi,

I seem to be getting a SocketTimeoutException every time I try to use param or params.

Here's my code:

println(Http("https://api.twitter.com/1/statuses/mentions.json").param("include_entities", "true").asString)

This also does not work:

println(Http("https://api.twitter.com/1/statuses/mentions.json?include_entities=true").asString)

Exception:

(run-main) java.net.SocketTimeoutException: connect timed out
java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
at java.net.Socket.connect(Socket.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:564)
at sun.net.NetworkClient.doConnect(NetworkClient.java:158)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:395)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:530)
at sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:272)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:329)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:133)
at scalaj.http.Http$$anonfun$1.apply(Http.scala:192)
at scalaj.http.Http$$anonfun$1.apply(Http.scala:192)
at scalaj.http.Http$Request.process(Http.scala:96)
at scalaj.http.Http$Request.apply(Http.scala:84)
at scalaj.http.Http$Request.asString(Http.scala:112)
at budogo.Runner$.main(Runner.scala:13)
at budogo.Runner.main(Runner.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
java.lang.RuntimeException: Nonzero exit code: 1

If I leave out the parameters everything works fine. Any ideas?