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
2
votes
1 answer

Correct mvn version for dispatch.databinder.net

The last version of the library dispatch.databinder.net is 0.9.5, according to the website. What is the correct mvn dependency? net.databinder.dispatch core_2.10
David Portabella
  • 12,390
  • 27
  • 101
  • 182
2
votes
2 answers

Methods to insert Oauth headers in Scala Dispatch 0.9.5?

Using the rather simple and elegant Scala Dispatch HTTP library. Since the Twitter Search API is now using OAuth 1.0A, I obviously need to start injecting Consumer and AccessToken information. I've got a simple request below: val request =…
crockpotveggies
  • 12,682
  • 12
  • 70
  • 140
2
votes
1 answer

Using query parameters with multiple values in Scala Dispatch 0.9.5

I'm using the excellent Dispatch library to make HTTP requests like so: Http(url("http://foo.bar/baz").GET < "value1") OK as.String) However, I'm talking to a REST service that expects param1 to be a list of values. How can I…
Josh Glover
  • 25,142
  • 27
  • 92
  • 129
2
votes
2 answers

How Do I Attach A Body To a Delete in Dispatch?

I have a Dispatch 0.8 DELETE handler that needs to have a body. So I have a normal DELETE that works fine: def delete = request.DELETE ># identity I tried this: def delete(body: String) = request.DELETE <<< body ># identity but it turned the…
DorkRawk
  • 732
  • 2
  • 6
  • 21
2
votes
2 answers

Return exact response/header?

From the client-side of a webapp, I hit a server-side route which is just a wrapper for a third-party API. Using dispatch, I am trying to make that server-side request return the exact header and response of the third-party API to the client-side…
user375566
2
votes
1 answer

Databinder dispatch: Get uncompressed content of a 403 response

I am using databinder dispatch for making HTTP requests which works nicely, as long as the web server returns a 404. If the request fails, the web server returns a 403 status code and provides a detailed error message in the response body as…
user3001
  • 3,437
  • 5
  • 28
  • 54
1
vote
3 answers

Ignoring SSL certificates in Scala dispatch

When trying to hit an environment with improperly configured SSL certificates, I get the following error: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated at…
prafulfillment
  • 911
  • 2
  • 11
  • 26
1
vote
1 answer

HTTP Post with scala and Dispatch?

I want to write a function for uploading photos to flickr as http://www.flickr.com/services/api/upload.api.html. I wrote the following code: val http = new Http with thread.Safety val uploadEndPoint = :/("api.flickr.com") / "services" /…
Feras Odeh
  • 9,136
  • 20
  • 77
  • 121
1
vote
1 answer

Getting an HTTP response as Array[Byte] with Scala and Dispatch

I'm trying to download the response of an HTTP GET request as an Array[Byte] in Scala using dispatch, but the documentation is not helping and online searches didn't turn out to be helpful. Additionally, I need to retrieve the value of a header in…
em70
  • 6,088
  • 6
  • 48
  • 80
1
vote
2 answers

Why does dispatch throw "java.net.ConnectException: General SSLEngine ..." and "unexpected status" exceptions for a particular URL?

I have the following non-working code: object Main extends App { import dispatch._ def test(address: String) = { Await.result(Http.default(url(address).GET OK as.String), Duration.Inf) } // This works fine val s1 =…
Bruno
  • 854
  • 7
  • 21
1
vote
1 answer

How to retrieve body string of request generated by scala-dispatch

I have a request generated by putting map of parameters val reqUrl = url("http://example.com") val req = reqUrl << Map("key" -> "value") I need to get request body in order to calculate it's hash. I'm trying this way val data =…
Poni Poni
  • 113
  • 2
  • 5
1
vote
1 answer

Scala Dispatch How to enable SNI

We have a website that makes 'get' requests to a server. We have now been informed that we need to add SNI information to the requests. We use Dispatch for our http calls. How do I enable SNI in Dispatch? scala: 2.11.7 Dispatch: 0.11.2
An Illusion
  • 769
  • 1
  • 10
  • 24
1
vote
1 answer

how to get the response content with dispatch?

I have looked at the dispatch tutorial, and can easily find how to get the header information (if the status is 200, if I have understood other posts) for instance with; def main(args: Array[String]){ val svc = url("http://www.google.com") …
stian
  • 1,947
  • 5
  • 25
  • 47
1
vote
2 answers

Getting response times

Is there a simple way to get the response time for a request to a url (other than keeping track of time in the code separately)? import dispatch._, Defaults._ import scala.util.{Failure, Success} val svc = dispatch.url(url) val response:…
FelixHJ
  • 1,071
  • 3
  • 12
  • 26
1
vote
0 answers

Need some examples of dispatch-nio to make several Http requests

I m using dispatch-nio library to make several Http request calls. But I cannot find an example how to handle callback responses through nio library. And also I am unable to handle exceptions thrown by nio.Http call. Could anyone please post an…
DSKVP
  • 663
  • 2
  • 11
  • 19