-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8254eb7
commit ad4185b
Showing
4 changed files
with
56 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//> using target.platform native | ||
package sttp.client4.curl.cats | ||
|
||
import cats.effect.kernel.Async | ||
import sttp.client4.Backend | ||
import sttp.client4.curl.AbstractCurlBackend | ||
import sttp.client4.impl.cats.CatsMonadAsyncError | ||
import sttp.client4.wrappers.FollowRedirectsBackend | ||
import sttp.client4.curl.internal.* | ||
import sttp.client4.curl.* | ||
import sttp.client4.curl.internal.CurlApi.* | ||
|
||
class CatsCurlBackend[F[_]: Async](verbose: Boolean) | ||
extends AbstractCurlBackend(new CatsMonadAsyncError[F], verbose) | ||
with Backend[F]: | ||
override def performCurl(c: CurlHandle): F[CurlCode.CurlCode] = monad.blocking(c.perform) | ||
|
||
object CatsCurlBackend: | ||
def apply[F[_]: Async](verbose: Boolean = false): Backend[F] = FollowRedirectsBackend(new CatsCurlBackend[F](verbose)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//> using target.platform native | ||
package tgtg.http | ||
|
||
import cats.effect.{IO, Resource} | ||
import sttp.client4.curl.cats.CatsCurlBackend | ||
import sttp.client4.Backend | ||
|
||
def httpBackend: Resource[IO, Backend[IO]] = Resource.pure(CatsCurlBackend()) |