Skip to content

Commit

Permalink
replaced deprecated Uri.uri(...) with uri(...)
Browse files Browse the repository at this point in the history
Per Issue http4s#2063 Remove Uri.uri calls in the docs.
http4s#2603
  • Loading branch information
mcintdan committed May 29, 2019
1 parent 2c0507d commit f44d38a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/src/main/tut/client.md
Expand Up @@ -131,7 +131,7 @@ import scala.concurrent.ExecutionContext.Implicits.global

```tut:book
def hello(name: String): IO[String] = {
val target = Uri.uri("http://localhost:8080/hello/") / name
val target = uri("http://localhost:8080/hello/") / name
httpClient.expect[String](target)
}
Expand Down Expand Up @@ -165,10 +165,10 @@ want to access.

There are a number of ways to construct a `Uri`.

If you have a literal string, you can use `Uri.uri(...)`:
If you have a literal string, you can use `uri(...)`:

```tut:book
Uri.uri("https://my-awesome-service.com/foo/bar?wow=yeah")
uri("https://my-awesome-service.com/foo/bar?wow=yeah")
```

This only works with literal strings because it uses a macro to validate the URI
Expand All @@ -189,7 +189,7 @@ val parseFailure: Either[ParseFailure, Uri] = Uri.fromString(invalidUri)
You can also build up a URI incrementally, e.g.:

```tut:book
val baseUri = Uri.uri("http://foo.com")
val baseUri = uri("http://foo.com")
val withPath = baseUri.withPath("/bar/baz")
val withQuery = withPath.withQueryParam("hello", "world")
```
Expand Down Expand Up @@ -287,7 +287,7 @@ to add a label to every metric based on the `Request`
You can send a GET by calling the `expect` method on the client, passing a `Uri`:

```tut:book
httpClient.expect[String](Uri.uri("https://google.com/"))
httpClient.expect[String](uri("https://google.com/"))
```

If you need to do something more complicated like setting request headers, you
Expand All @@ -301,7 +301,7 @@ import org.http4s.MediaType

```tut:book
val request = GET(
Uri.uri("https://my-lovely-api.com/"),
uri("https://my-lovely-api.com/"),
Authorization(Credentials.Token(AuthScheme.Bearer, "open sesame")),
Accept(MediaType.application.json)
)
Expand All @@ -323,7 +323,7 @@ val postRequest = POST(
"client_id" -> "my-awesome-client",
"client_secret" -> "s3cr3t"
),
Uri.uri("https://my-lovely-api.com/oauth2/token")
uri("https://my-lovely-api.com/oauth2/token")
)
httpClient.expect[AuthResponse](postRequest)
Expand Down

0 comments on commit f44d38a

Please sign in to comment.