Comments (4)
Ok - I don't know what's going on, but as of writing this, it seems dilbert.com is working. But I get similar errors from other sites:
scala> val html = Http("http://www.sinfest.net").asString
java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
scala> val html = Http("http://nyt.fi/category/sarjakuvat/").asString
java.net.SocketTimeoutException: Read timed out
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1674)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1672)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1670)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1243)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
at scalaj.http.Http$Request.process(Http.scala:125)
Both URLs above work ok with "curl -I".
Am I using the library wrong, or what could be going on?
from scalaj-http.
https://github.com/scalaj/scalaj-http#custom-connect-and-read-timeouts
from scalaj-http.
Thanks for pointing me to these! To me the defaults look a bit too low for "real life" network conditions, no? I would expect timeouts to be in the order of seconds...
from scalaj-http.
"real life" depends greatly on your use case. The library's first use was within a web application where longer timeouts would cause undesirable latencies for end users.
from scalaj-http.
Related Issues (20)
- any reason it still uses sbt 0.13.x instead of 1.2.x? HOT 2
- publish for Scala 2.13 HOT 1
- Authentication with bearer token not working HOT 1
- data-urlencode option HOT 1
- OAuth1 RSA SHA1 signature support HOT 1
- callback passed to exec invoked 2 times, swallows original exception and passes null as input stream HOT 3
- reflections complicate using scalaj in graal builds
- Support for hostname validation HOT 2
- Custom options HOT 2
- HTTP endpoint that requires a JSON-formatted body HOT 3
- Question: Does the api throw exceptions? HOT 2
- Send a get request with body HOT 3
- scalaj.http.HttpResponse does not take type parameters HOT 3
- Provide Automatic-Module-Name
- Multipart post request fails randomly with error java.io.IOException: insufficient data written
- NoSuchMethodError in runtime for scalaj-http_2.12
- NoClassDefFoundError: Could not initialize class scalaj.http.DefaultConnectFunc$
- HTTP basic authentication in the URL is not available HOT 5
- Cannot GET with JSON -- like curl -X GET -d "jsonKey:jsonVal" HOT 5
- Anything similar for send data as a form body HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scalaj-http.