calaxb_2.12.1.12.1.source-code.httpclients_gigahorse02_async.scala.template Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scalaxb_2.12 Show documentation
Show all versions of scalaxb_2.12 Show documentation
scalaxb is an XML data-binding tool for Scala that supports W3C XML Schema (xsd) and wsdl.
The newest version!
package scalaxb
import scala.concurrent._, duration._
trait GigahorseHttpClientsAsync extends HttpClientsAsync {
lazy val httpClient = new GigahorseHttpClient {}
def connectionTimeout: FiniteDuration = 5.seconds
def requestTimeout: FiniteDuration = 60.seconds
trait GigahorseHttpClient extends HttpClient {
import gigahorse.support.%%BACKEND%%.Gigahorse._
lazy val client = http(config
.withConnectTimeout(connectionTimeout)
.withRequestTimeout(requestTimeout))
def request(in: String, address: java.net.URI, headers: Map[String, String])(implicit ec: ExecutionContext): Future[String] = {
val req = url(address.toString).post(in).withHeaders(headers.mapValues(List(_)).toMap)
client.processFull(req, asString)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy