Questions tagged [scala-dispatch]

Dispatch is a library for asynchronous HTTP interaction. It provides a Scala vocabulary for Java’s async-http-client.

Dispatch is a library for asynchronous HTTP interaction. It provides a Scala vocabulary for Java’s async-http-client.

http://dispatch.databinder.net/Dispatch.html

91 questions
4
votes
1 answer

Are there any Scala OAuth libraries that support OAuth 2.0?

I'm looking for both consumer and provider code. Dispatch and Lift's OAuth code both only target OAuth 1.0 right now.
pr1001
  • 21,727
  • 17
  • 79
  • 125
4
votes
2 answers

How to use dispatch.json in lift project

i am confused on how to combine the json library in dispatch and lift to parse my json response. I am apparently a scala newbie. I have written this code : val status = { val httpPackage = http(Status(screenName).timeline) val json1 =…
user365916
4
votes
1 answer

multipart/form-data using scala-dispatch

I am using scala-dispatch library as http client. I wanna post multipart/form-data with form values. Can anyone help me? My Code: val host_url : Req =…
Sunder
  • 223
  • 1
  • 2
  • 10
4
votes
1 answer

Error when accessing Rdio oauth API with dispatch in scala

I am trying to use scala dispatch to access the Rdio API like this: import dispatch.url import dispatch.Http import dispatch.Defaults.executor import dispatch._ import com.ning.http.client.oauth.ConsumerKey import dispatch.oauth._ val consumer =…
Daniel Cukier
  • 11,502
  • 15
  • 68
  • 123
4
votes
1 answer

Sequencing `Future`s with timeout

I utilized the TimeoutScheduler introduced at Scala Futures - built in timeout?. However, now my program does not terminate as before without TimeoutScheduler. I have two Futures: res1 and res2. Both with a timeout of 15 seconds. In the end I…
nemron
  • 701
  • 6
  • 23
4
votes
1 answer

Sending a custom POST https request in dispatch (+cookies, + headers)

There is some documentation about sending post request in dispatch http://dispatch.databinder.net/Combined+Pages.html but yet it's not clear. What are myRequest and myPost there? I want to send a https post request + add some cookies manually via…
Incerteza
  • 32,326
  • 47
  • 154
  • 261
4
votes
4 answers

Decode a streaming GZIP response in Scala Dispatch?

Receiving a Gzipped response from an API, but Dispatch 0.9.5 doesn't appear to have any methods to decode the response. Any ideas? Here's my current implementation, the println only prints out string representations of bytes. Http( …
crockpotveggies
  • 12,682
  • 12
  • 70
  • 140
4
votes
0 answers

net.databinder.dispatch failing with too many keep-alive connections

I use net.databinder.dispatch to call a web server with this: import dispatch._ def request(in: String, address: java.net.URI, headers: Map[String, String]): String = { val req = url(address.toString) << in <:< headers val s = Http(req OK…
David Portabella
  • 12,390
  • 27
  • 101
  • 182
4
votes
1 answer

Performing a simple HTTP GET with Dispatch

The following is a valid query in a browser (e.g. Firefox): http://www.freesound.org/api/sounds/search/?q=barking&api_key=074c0b328aea46adb3ee76f6918f8fae yielding a JSON document: { "num_results": 610, "sounds": [ { …
0__
  • 66,707
  • 21
  • 171
  • 266
4
votes
2 answers

Disable SSL with Scala Dispatch Library

I am currently in the process of moving all our Rest tests to the CI server and have noticed that all tests are failing due to the an SSL handshake, now I have successfully disabled this with the TrustManager with our Java test suite, but am unsure…
user1697841
  • 109
  • 3
  • 11
3
votes
1 answer

Getting a 302 http redirect location with Databinder-Dispatch

With databinder-dispatch 0.8.3 I'm trying to get the redirect url from a 302 http response, but I get the following exception: Caused by: dispatch.StatusCode: Unexpected response code: 302 Here's what I've attempted, with some help: import…
Carlos López-Camey
  • 2,504
  • 1
  • 17
  • 20
3
votes
1 answer

Scala/Dispatch program isn't terming

I am trying to learn Scala and have the following issue, when running the below program the response is printed but it never terminates: object Demo { def main(args: Array[String]): Unit = { import dispatch._ import…
Horea Popa
  • 70
  • 2
  • 10
3
votes
3 answers

http(/* argument here */) How is this Object (Http) being used without an explicit or implicit method?

In the example for coding with Json using Databinder Dispatch Nathan uses an Object (Http) without a method, shown here: import dispatch._ import Http._ Http("http://www.fox.com/dollhouse/" >>> System.out ) How is he doing this? Thank you for all…
Randin
  • 1,875
  • 3
  • 17
  • 14
3
votes
2 answers

What is a simple way to receive SNMP traps in Scala?

I'd love it if there is an awesome native Scala library for SNMP like there is Dispatch for HTTP but I can't find one. Is there one? Baring that, should I use a Java library like SNMP4J? What I want to do is so simple that it almost seems like…
pr1001
  • 21,727
  • 17
  • 79
  • 125
3
votes
1 answer

Scala dispatch stream response line by line

I am attempting to use Scala dispatch but been both a Scala neewbie and the face that Dispatch api is symbol crazy Im confused on how I can stream a large http response and process it line by line. Any help would be appreciated. Cheers, Chris. …
Owen
  • 6,992
  • 7
  • 44
  • 77