|
|
|
@ -82,7 +82,7 @@ as the following example shows: |
|
|
|
.build("Westin", "123") |
|
|
|
.build("Westin", "123") |
|
|
|
---- |
|
|
|
---- |
|
|
|
|
|
|
|
|
|
|
|
You shorter it further still with a full URI template, as the following example shows: |
|
|
|
You can shorten it further still with a full URI template, as the following example shows: |
|
|
|
|
|
|
|
|
|
|
|
[source,java,indent=0,subs="verbatim,quotes",role="primary"] |
|
|
|
[source,java,indent=0,subs="verbatim,quotes",role="primary"] |
|
|
|
.Java |
|
|
|
.Java |
|
|
|
@ -94,7 +94,7 @@ You shorter it further still with a full URI template, as the following example |
|
|
|
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"] |
|
|
|
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"] |
|
|
|
.Kotlin |
|
|
|
.Kotlin |
|
|
|
---- |
|
|
|
---- |
|
|
|
val uri = UriComponentsBuilder |
|
|
|
val uri = UriComponentsBuilder |
|
|
|
.fromUriString("https://example.com/hotels/{hotel}?q={q}") |
|
|
|
.fromUriString("https://example.com/hotels/{hotel}?q={q}") |
|
|
|
.build("Westin", "123") |
|
|
|
.build("Westin", "123") |
|
|
|
---- |
|
|
|
---- |
|
|
|
@ -250,7 +250,7 @@ as the following example shows: |
|
|
|
---- |
|
|
|
---- |
|
|
|
URI uri = UriComponentsBuilder.fromPath("/hotel list/{city}") |
|
|
|
URI uri = UriComponentsBuilder.fromPath("/hotel list/{city}") |
|
|
|
.queryParam("q", "{q}") |
|
|
|
.queryParam("q", "{q}") |
|
|
|
.build("New York", "foo+bar") |
|
|
|
.build("New York", "foo+bar"); |
|
|
|
---- |
|
|
|
---- |
|
|
|
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"] |
|
|
|
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"] |
|
|
|
.Kotlin |
|
|
|
.Kotlin |
|
|
|
@ -265,13 +265,13 @@ You can shorten it further still with a full URI template, as the following exam |
|
|
|
[source,java,indent=0,subs="verbatim,quotes",role="primary"] |
|
|
|
[source,java,indent=0,subs="verbatim,quotes",role="primary"] |
|
|
|
.Java |
|
|
|
.Java |
|
|
|
---- |
|
|
|
---- |
|
|
|
URI uri = UriComponentsBuilder.fromPath("/hotel list/{city}?q={q}") |
|
|
|
URI uri = UriComponentsBuilder.fromUriString("/hotel list/{city}?q={q}") |
|
|
|
.build("New York", "foo+bar") |
|
|
|
.build("New York", "foo+bar"); |
|
|
|
---- |
|
|
|
---- |
|
|
|
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"] |
|
|
|
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"] |
|
|
|
.Kotlin |
|
|
|
.Kotlin |
|
|
|
---- |
|
|
|
---- |
|
|
|
val uri = UriComponentsBuilder.fromPath("/hotel list/{city}?q={q}") |
|
|
|
val uri = UriComponentsBuilder.fromUriString("/hotel list/{city}?q={q}") |
|
|
|
.build("New York", "foo+bar") |
|
|
|
.build("New York", "foo+bar") |
|
|
|
---- |
|
|
|
---- |
|
|
|
|
|
|
|
|
|
|
|
|