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
1
vote
0 answers

Configuring Scala Dispatch to use HTTP/1.0

I'm using Dispatch v0.11.0. I want to use it to send HTTP/1.0 requests. I can see that it is possible to configure a few things: val dispatcher = Http.configure(_.setRequestTimeoutInMs(timeoutMs)) However I cannot find a way to configure the…
sungiant
  • 3,152
  • 5
  • 32
  • 49
1
vote
1 answer

Chain multiple method calls using a map in Scala

I have the following code using Dispatch 0.11: def myHttpPut(urlToPut: String, params: Map[String, String]): Future[Response] = { val req = url(urlToPut).PUT params.foreach { case (k, v) => req.addParameter(k, v) } Http(req) } This does not…
ghodss
  • 1,329
  • 1
  • 9
  • 9
1
vote
0 answers

Scala Dispatch REST GET example

I have a client that makes a REST call to a server that exposes REST API's. Here is what I have so far implemented: override def getData[T](reqURL: String, requestParam: Option[Seq[(String, String)]])(responseHandler: T => Unit) = { val…
joesan
  • 13,963
  • 27
  • 95
  • 232
1
vote
1 answer

How to use "dispatch" HTTP client library in Scala for that case?

Suppose I am using dispatch to call a REST API in Scala. The API may return very large responses that don't fit the memory I have. So I would like to read a response from the network in a fixed-size buffer and raise an exception (return an error) if…
Michael
  • 41,026
  • 70
  • 193
  • 341
1
vote
2 answers

How should I wait for a scala dispatch (0.11.0) http get request to be completed?

I'm using the scala dispatch (0.11.0) library to send an HTTP GET request to a remote server. I want to wait for the response before executing the code which follows the request. My request is of the form : val req = :/("myurl.com") <:< myheaders OK…
ygu
  • 345
  • 1
  • 16
1
vote
1 answer

Scala Dispatch Simple Get Request

I am trying to execute a Simple GET request with Scala Dispatch, however I am erroring out with a 404 error. Unexpected response status: 404 Here is a example that works: https://www.google.com/finance/info?infotype=infoquoteall&q=tsla,goog But am…
Lilluda 5
  • 1,111
  • 3
  • 18
  • 38
1
vote
1 answer

Setting a cookie for HTTP POST in Scala with Dispatch

I can't seem to set a cookie using Dispatch. The server resends a new session ID implying that the one I tried to send didn't get sent in the right way. Here is the code: val domain = "myhost.com" val host_req = host(domain).secure val request =…
Raindog
  • 1,468
  • 3
  • 14
  • 28
1
vote
1 answer

Scala Dispatch Databinder library throws java.nio.BufferUnderflowException

I am using the Dispatch Databinder library for Http in Scala. I have this method. def testCheckPage(url:String):String = { try { var http = new Http var request = new Request(url) val…
user204492
1
vote
1 answer

Import works, but does not import everything in the package?

I'm trying to use dispatch with a 3rd party website that has an OAuth authentication, but I'm having trouble importing things from dispatch. Consumer api it is clearly there in the library, but for some reason it is not found. I'm using sbt to build…
Zavior
  • 6,412
  • 2
  • 29
  • 38
1
vote
1 answer

Simple ScalaXB example causes NoSuchMethodError in Dispatch

I am new to Scala and I was trying out an example with ScalaXB. I am using IntelliJ IDEA and the latest Scala version 2.10.1. ScalaXB uses Dispatch so I added that (version 0.9.5) as a dependency to the project. I also had to add as a dependency…
Teodor Kostov
  • 313
  • 1
  • 11
1
vote
2 answers

Dispatch and library dependencies

Hi I am turning here as a last resort but I'm at my wits end. I was trying to learn dispatch so I can do my next web project in scala but I can't even make it past the tutorial. This is what I'm trying to do. import dispatch._ val h = new Http val…
dcole2929
  • 357
  • 2
  • 11
1
vote
1 answer

Scala dispatch reboot timeout

I am using the dispatch reboot library version 0.9.5 (http://dispatch.databinder.net/Dispatch.html) in my project. Via sbt I have the following line: libraryDependencies += "net.databinder.dispatch" %% "dispatch-core" % "0.9.5" In the scala (2.9.2)…
Alex Wilson
  • 6,690
  • 27
  • 44
1
vote
1 answer

How to use the DELETE request in Dispatch for Scala?

I what to do is to make a DELETE request using dispatch. I know how to use it in POST and GET, but it seems that I can't find samples on how to use DELETE?
jeypijeypi
  • 373
  • 1
  • 4
  • 12
0
votes
1 answer

Get OAuth Request token from Flickr using Dispatch?

How could I get request token from Flickr using Dispatch Scala library? Is it possible using Dispatch to get base string? and sign requests?
Feras Odeh
  • 9,136
  • 20
  • 77
  • 121
0
votes
1 answer

What's the equivalent HttpClient Java code for this Dispatch Scala?

import dispatch._ val h = new Http val req = url(url).as_!(username, password) val handler = req << (payload, "application/xml") >:> identity handler.apply { case (200, _, Some(entity), _) => (200, Some(entity)) case (status, _,_,_) =>…
prafulfillment
  • 911
  • 2
  • 11
  • 26