Skip to content

Commit

Permalink
Change package name and artifact organization to sttp.client3
Browse files Browse the repository at this point in the history
  • Loading branch information
adamw committed Sep 16, 2020
1 parent 067cf6a commit 3f47b1c
Show file tree
Hide file tree
Showing 359 changed files with 1,331 additions and 1,330 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Join the chat at https://gitter.im/softwaremill/sttp](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/softwaremill/sttp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/softwaremill/sttp.svg?branch=master)](https://travis-ci.org/softwaremill/sttp)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.softwaremill.sttp.client/core_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.softwaremill.sttp.client/core_2.12)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.softwaremill.sttp.client3/core_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.softwaremill.sttp.client3/core_2.12)

The Scala HTTP client that you always wanted!

Expand All @@ -16,7 +16,7 @@ Backend implementations include ones based on [akka-http](https://doc.akka.io/do
Here's a very quick example of sttp client in action:

```scala
import sttp.client._
import sttp.client3._

val sort: Option[String] = None
val query = "http language:scala"
Expand All @@ -37,19 +37,21 @@ println(response.body)

## Documentation

sttp (v2) documentation is available at [sttp.softwaremill.com](http://sttp.softwaremill.com).
sttp (v3) documentation is available at [sttp.softwaremill.com](http://sttp.softwaremill.com).

sttp (v2) documentation is available at [sttp.softwaremill.com/en/v2](http://sttp.softwaremill.com/en/v2).

sttp (v1) documentation is available at [sttp.softwaremill.com/en/v1](https://sttp.softwaremill.com/en/v1).

scaladoc is available at [https://www.javadoc.io](https://www.javadoc.io/doc/com.softwaremill.sttp.client/core_2.12/3.0.0-RC3)
scaladoc is available at [https://www.javadoc.io](https://www.javadoc.io/doc/com.softwaremill.sttp.client3/core_2.12/3.0.0-RC3)

## Quickstart with Ammonite

If you are an [Ammonite](http://ammonite.io) user, you can quickly start experimenting with sttp by copy-pasting the following:

```scala
import $ivy.`com.softwaremill.sttp.client::core:3.0.0-RC3`
import sttp.client.quick._
import $ivy.`com.softwaremill.sttp.client3::core:3.0.0-RC3`
import sttp.client3.quick._
quickRequest.get(uri"http://httpbin.org/ip").send(backend)
```

Expand All @@ -60,13 +62,13 @@ This brings in the sttp API and an implicit, synchronous backend.
Add the following dependency:

```scala
"com.softwaremill.sttp.client" %% "core" % "3.0.0-RC3"
"com.softwaremill.sttp.client3" %% "core" % "3.0.0-RC3"
```

Then, import:

```scala
import sttp.client._
import sttp.client3._
```

Type `sttp.` and see where your IDE’s auto-complete gets you!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sttp.client.akkahttp
package sttp.client3.akkahttp

import java.io.UnsupportedEncodingException

Expand All @@ -15,10 +15,10 @@ import akka.stream.Materializer
import akka.stream.scaladsl.Flow
import sttp.capabilities.akka.AkkaStreams
import sttp.capabilities.{Effect, WebSockets}
import sttp.client
import sttp.client.akkahttp.AkkaHttpBackend.EncodingHandler
import sttp.client.testing.SttpBackendStub
import sttp.client.{FollowRedirectsBackend, Response, SttpBackend, SttpBackendOptions, _}
import sttp.client3
import sttp.client3.akkahttp.AkkaHttpBackend.EncodingHandler
import sttp.client3.testing.SttpBackendStub
import sttp.client3.{FollowRedirectsBackend, Response, SttpBackend, SttpBackendOptions, _}
import sttp.model.StatusCode
import sttp.monad.{FutureMonad, MonadError}

Expand Down Expand Up @@ -115,10 +115,10 @@ class AkkaHttpBackend private (

val headers = FromAkka.headers(hr)

val responseMetadata = client.ResponseMetadata(headers, code, statusText)
val responseMetadata = client3.ResponseMetadata(headers, code, statusText)
val body = bodyFromAkka(r.response, responseMetadata, wsFlow.map(Right(_)).getOrElse(Left(decodeAkkaResponse(hr))))

body.map(client.Response(_, code, statusText, headers, Nil, r.onlyMetadata))
body.map(client3.Response(_, code, statusText, headers, Nil, r.onlyMetadata))
}

// http://doc.akka.io/docs/akka-http/10.0.7/scala/http/common/de-coding.html
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sttp.client.akkahttp
package sttp.client3.akkahttp

import akka.actor.ActorSystem
import akka.event.LoggingAdapter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sttp.client.akkahttp
package sttp.client3.akkahttp

import java.util.concurrent.atomic.AtomicBoolean

Expand All @@ -9,9 +9,9 @@ import akka.stream.{Materializer, OverflowStrategy, QueueOfferResult}
import akka.util.ByteString
import akka.{Done, NotUsed}
import sttp.capabilities.akka.AkkaStreams
import sttp.client.internal.{BodyFromResponseAs, SttpFile}
import sttp.client.ws.{GotAWebSocketException, NotAWebSocketException}
import sttp.client.{
import sttp.client3.internal.{BodyFromResponseAs, SttpFile}
import sttp.client3.ws.{GotAWebSocketException, NotAWebSocketException}
import sttp.client3.{
ResponseAs,
ResponseAsWebSocket,
ResponseAsWebSocketStream,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sttp.client.akkahttp
package sttp.client3.akkahttp

import akka.http.scaladsl.model.{
ContentType,
Expand All @@ -12,8 +12,8 @@ import akka.http.scaladsl.model.{
import akka.stream.scaladsl.{Source, StreamConverters}
import akka.util.ByteString
import sttp.capabilities.akka.AkkaStreams
import sttp.client.internal.throwNestedMultipartNotAllowed
import sttp.client.{
import sttp.client3.internal.throwNestedMultipartNotAllowed
import sttp.client3.{
ByteArrayBody,
ByteBufferBody,
FileBody,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package sttp.client.akkahttp
package sttp.client3.akkahttp

import akka.http.scaladsl.model.HttpResponse
import sttp.client.{Request, SttpClientException}
import sttp.client3.{Request, SttpClientException}
import sttp.model.{Header, HeaderNames}

import scala.collection.immutable.Seq
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package sttp.client.akkahttp
package sttp.client3.akkahttp

import akka.http.scaladsl.model.{HttpHeader, HttpMethod, HttpMethods, HttpRequest}
import akka.http.scaladsl.model.HttpHeader.ParsingResult
import sttp.client.Request
import sttp.client3.Request
import sttp.model.{Header, Method}

import scala.collection.immutable.Seq
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package sttp.client.akkahttp
package sttp.client3.akkahttp

import akka.http.scaladsl.model.ContentType
import akka.http.scaladsl.model.ContentTypes.`application/octet-stream`
import akka.http.scaladsl.model.headers.{`Content-Length`, `Content-Type`}
import sttp.client.Request
import sttp.client3.Request
import sttp.model.Header

import scala.collection.immutable.Seq
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package sttp.client.akkahttp
package sttp.client3.akkahttp

import sttp.client.SttpBackend
import sttp.client.testing.{ConvertToFuture, HttpTest}
import sttp.client3.SttpBackend
import sttp.client3.testing.{ConvertToFuture, HttpTest}

import scala.concurrent.Future

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package sttp.client.akkahttp
package sttp.client3.akkahttp

import akka.actor.ActorSystem
import akka.http.scaladsl.server.Route
import org.scalatest.BeforeAndAfterAll
import sttp.client.SttpBackend
import sttp.client3.SttpBackend
import sttp.model.StatusCode

import scala.concurrent.duration._
Expand All @@ -22,7 +22,7 @@ class AkkaHttpRouteBackendTest extends AsyncWordSpec with Matchers with BeforeAn
val backend: SttpBackend[Future, Any] =
AkkaHttpBackend.usingClient(system, http = AkkaHttpClient.stubFromRoute(Routes.route))

import sttp.client._
import sttp.client3._

"matched route" should {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package sttp.client.akkahttp
package sttp.client3.akkahttp

import akka.actor.ActorSystem
import akka.stream.scaladsl.Source
import akka.util.ByteString
import sttp.capabilities.akka.AkkaStreams
import sttp.client.SttpBackend
import sttp.client.testing.ConvertToFuture
import sttp.client.testing.streaming.StreamingTest
import sttp.client3.SttpBackend
import sttp.client3.testing.ConvertToFuture
import sttp.client3.testing.streaming.StreamingTest

import scala.concurrent.Future

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package sttp.client.akkahttp
package sttp.client3.akkahttp

import akka.NotUsed
import akka.stream.scaladsl.{Flow, Source}
import sttp.capabilities.WebSockets
import sttp.capabilities.akka.AkkaStreams
import sttp.client._
import sttp.client.testing.ConvertToFuture
import sttp.client.testing.websocket.{WebSocketStreamingTest, WebSocketTest}
import sttp.client3._
import sttp.client3.testing.ConvertToFuture
import sttp.client3.testing.websocket.{WebSocketStreamingTest, WebSocketTest}
import sttp.monad.{FutureMonad, MonadError}
import sttp.ws.WebSocketFrame

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package sttp.client.akkahttp
package sttp.client3.akkahttp

import akka.actor.ActorSystem
import org.scalatest.BeforeAndAfterAll
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import sttp.client._
import sttp.client3._

import scala.concurrent.Await
import scala.concurrent.ExecutionContext.Implicits.global
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sttp.client.asynchttpclient.cats
package sttp.client3.asynchttpclient.cats

import java.io.{ByteArrayInputStream, File}
import java.nio.ByteBuffer
Expand All @@ -14,13 +14,13 @@ import org.asynchttpclient.{
DefaultAsyncHttpClientConfig
}
import org.reactivestreams.Publisher
import sttp.client.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC}
import sttp.client.impl.cats.CatsMonadAsyncError
import sttp.client.internal.{FileHelpers, NoStreams}
import sttp.client.{FollowRedirectsBackend, Request, Response, SttpBackend, SttpBackendOptions}
import sttp.client3.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC}
import sttp.client3.impl.cats.CatsMonadAsyncError
import sttp.client3.internal.{FileHelpers, NoStreams}
import sttp.client3.{FollowRedirectsBackend, Request, Response, SttpBackend, SttpBackendOptions}
import cats.implicits._
import sttp.client.internal.ws.SimpleQueue
import sttp.client.testing.SttpBackendStub
import sttp.client3.internal.ws.SimpleQueue
import sttp.client3.testing.SttpBackendStub
import sttp.monad.MonadAsyncError
import sttp.ws.WebSocket

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package sttp.client.asynchttpclient.cats
package sttp.client3.asynchttpclient.cats

import java.util.concurrent.TimeoutException

import cats.effect.IO
import sttp.client._
import sttp.client.impl.cats.CatsTestBase
import sttp.client.testing.{CancelTest, HttpTest}
import sttp.client3._
import sttp.client3.impl.cats.CatsTestBase
import sttp.client3.testing.{CancelTest, HttpTest}

import scala.concurrent.duration._

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sttp.client.asynchttpclient.fs2
package sttp.client3.asynchttpclient.fs2

import java.io.File
import java.nio.ByteBuffer
Expand All @@ -14,13 +14,13 @@ import org.asynchttpclient.{Request => _, Response => _, _}
import org.reactivestreams.Publisher
import sttp.capabilities.WebSockets
import sttp.capabilities.fs2.Fs2Streams
import sttp.client.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC}
import sttp.client.impl.cats.CatsMonadAsyncError
import sttp.client.impl.fs2.{Fs2SimpleQueue, Fs2WebSockets}
import sttp.client.internal._
import sttp.client.internal.ws.SimpleQueue
import sttp.client.testing.SttpBackendStub
import sttp.client.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions, _}
import sttp.client3.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC}
import sttp.client3.impl.cats.CatsMonadAsyncError
import sttp.client3.impl.fs2.{Fs2SimpleQueue, Fs2WebSockets}
import sttp.client3.internal._
import sttp.client3.internal.ws.SimpleQueue
import sttp.client3.testing.SttpBackendStub
import sttp.client3.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions, _}
import sttp.monad.MonadAsyncError
import sttp.ws.{WebSocket, WebSocketFrame}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package sttp.client.asynchttpclient.fs2
package sttp.client3.asynchttpclient.fs2

import cats.effect.{Blocker, ContextShift, IO}
import sttp.capabilities.fs2.Fs2Streams
import sttp.client.impl.fs2.Fs2StreamingTest
import sttp.client.SttpBackend
import sttp.client3.impl.fs2.Fs2StreamingTest
import sttp.client3.SttpBackend

import scala.concurrent.ExecutionContext
import scala.concurrent.ExecutionContext.global
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package sttp.client.asynchttpclient.fs2
package sttp.client3.asynchttpclient.fs2

import cats.effect.{Blocker, IO}
import sttp.client.SttpBackend
import sttp.client.impl.cats.CatsTestBase
import sttp.client.testing.HttpTest
import sttp.client3.SttpBackend
import sttp.client3.impl.cats.CatsTestBase
import sttp.client3.testing.HttpTest

import scala.concurrent.ExecutionContext.global

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package sttp.client.asynchttpclient.fs2
package sttp.client3.asynchttpclient.fs2

import cats.effect.{Blocker, IO}
import cats.implicits._
import fs2.Pipe
import sttp.capabilities.WebSockets
import sttp.capabilities.fs2.Fs2Streams
import sttp.client._
import sttp.client.asynchttpclient.AsyncHttpClientWebSocketTest
import sttp.client.impl.cats.CatsTestBase
import sttp.client.impl.fs2.Fs2WebSockets
import sttp.client3._
import sttp.client3.asynchttpclient.AsyncHttpClientWebSocketTest
import sttp.client3.impl.cats.CatsTestBase
import sttp.client3.impl.fs2.Fs2WebSockets
import sttp.ws.WebSocketFrame

import scala.concurrent.ExecutionContext.global
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sttp.client.asynchttpclient.future
package sttp.client3.asynchttpclient.future

import java.nio.ByteBuffer

Expand All @@ -11,11 +11,11 @@ import org.asynchttpclient.{
DefaultAsyncHttpClientConfig
}
import org.reactivestreams.Publisher
import sttp.client.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC}
import sttp.client.internal.NoStreams
import sttp.client.internal.ws.SimpleQueue
import sttp.client.testing.SttpBackendStub
import sttp.client.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions}
import sttp.client3.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC}
import sttp.client3.internal.NoStreams
import sttp.client3.internal.ws.SimpleQueue
import sttp.client3.testing.SttpBackendStub
import sttp.client3.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions}
import sttp.monad.{FutureMonad, MonadAsyncError}
import sttp.ws.WebSocket

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package sttp.client.asynchttpclient.future
package sttp.client3.asynchttpclient.future

import sttp.client.SttpBackend
import sttp.client.testing.{ConvertToFuture, HttpTest}
import sttp.client3.SttpBackend
import sttp.client3.testing.{ConvertToFuture, HttpTest}

import scala.concurrent.Future

Expand Down
Loading

0 comments on commit 3f47b1c

Please sign in to comment.