Questions tagged [spray-client]

Spray-client provides high-level HTTP client functionality by adding another logic layer on top of the relatively basic spray-can HTTP Client APIs. It doesn’t yet provide all the features that we’d like to include eventually, but it should already be of some utility for many applications.

Spray-client provides high-level HTTP client functionality by adding another logic layer on top of the relatively basic spray-can HTTP Client APIs. It doesn’t yet provide all the features that we’d like to include eventually, but it should already be of some utility for many applications.

Currently it allows you to wrap any one of the three spray-can client-side API levels with a pipelining logic, which provides for:

- Convenient request building
- Authentication
- Compression / Decompression
- Marshalling / Unmarshalling from and to your custom types
71 questions
0
votes
2 answers

Spray : How to Unmarshal a response of JsArray or JsObject (ie JsValue) in pipeline

I am creating a service that aggregates data and will need to be able to read any unknown JSON document. I have the pipeline defined as follows: private def pipeline = ( addHeader("Accept", "application/json") ~> sendReceive ~>…
Eric
  • 127
  • 7
0
votes
1 answer

connection timeout of 10 seconds expired, stopping - Break Connection forever

I am trying to send a GET request to URL . val pipeline: HttpRequest => Future[HttpResponse] = ( sendReceive ) val result = Await.result(pipeline(Get(url)), DEFAULT_TIMEOUT) Once I get the following response, after which our…
Arpit
  • 227
  • 5
  • 15
0
votes
1 answer

Marshalling of `Map`s with Spray

I have been trying to marshal a bunch of Maps but I get error. Here is the definitions: import spray.httpx.SprayJsonSupport._ import spray.json.DefaultJsonProtocol._ import scala.collection.JavaConverters._ case class SchemaMap( schemaMap:…
Daniel
  • 5,839
  • 9
  • 46
  • 85
0
votes
1 answer

How to asynchronously get headers without downloading the entire page?

I want to implement logic to download parts (the first few megabytes) of http pages if the response content type is "text/html" (and check it without downloading the entire page) or skip otherwise. This is possible using Apache http client, but it…
Tolsi
  • 656
  • 9
  • 20
0
votes
0 answers

Spray.io unmarshaller for `application/atom+xml`

I'm having trouble writing an unmarshaller for an atom+xml feed. The feed is just XML, so I was hoping to be able to rely on the NodeSeqUnmarshaller, but that unmarshaller has content range (text/xml, application/xml, text/html,…
David
  • 5,184
  • 3
  • 41
  • 67
0
votes
1 answer

Handling http response in request level api in spray client

I'm using spray client's request level api to request a server. This is my code: var request: HttpRequest = HttpRequest(method, uri, headers, HttpEntity(MediaTypes.`application/json`, json.toString())) val result = for { resp <-…
Yoda
  • 442
  • 3
  • 14
0
votes
1 answer

Akka IO and TestActorRef

If I need to write an integration test involving HTTP request via spray-can, how can I make sure that spray-can is using CallingThreadDispatcher? Currently the following actor will print None class Processor extends Actor { override def receive =…
Igor S.
  • 553
  • 4
  • 10
0
votes
1 answer

Spray request - Complete request only after nested futures

New to spray and scala. Been struggling to get it right for couple of days now. I am trying to merge facebook oauth2 login + user login details into the database in case the same user logs in by different ways(user/pass or fb login). Pasting below…
user2489122
  • 111
  • 2
  • 13
0
votes
1 answer

Spray Client I want to return String from Json response

Sorry, but I am new to Scala. I have read about Futures and Akka, however I still have issue returning a string for my method. I have a method getAuthString which should return Authentication String(or Token). I have used spray Jsonsupport and I…
Sheggetin
  • 13
  • 3
0
votes
0 answers

Handling disconnects and reconnects in Spray and custom actor with Chunked Response

I'm new to Spray and trying to implement a client that receives a stream of data from a server. My current code looks like the following. The client send a request to the HTTP server which then responds back with a stream of data (as chunked…
Soumya Simanta
  • 11,523
  • 24
  • 106
  • 161
0
votes
2 answers

POST request using spray-client

I want to send XML over HTTP POST request to server using spray-client with some headers set etc. However, only examples that I can find are for JSON requests. Can somebody provide a simple snippet of code for XML over HTTP POST communication using…
Željko Trogrlić
  • 2,765
  • 1
  • 16
  • 20
1 2 3 4
5