From 1513e7be635acff7c5520b93e79991a5bb86791d Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 16 Feb 2018 14:25:13 +0100 Subject: [PATCH] Polishing --- src/docs/asciidoc/integration.adoc | 10 +++++----- src/docs/asciidoc/web/web-uris.adoc | 22 +++++++++------------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/docs/asciidoc/integration.adoc b/src/docs/asciidoc/integration.adoc index 59fad9db97d..0ba5d71c204 100644 --- a/src/docs/asciidoc/integration.adoc +++ b/src/docs/asciidoc/integration.adoc @@ -1140,8 +1140,8 @@ other method arguments. ===== Working with the URI For each of the main HTTP methods, the `RestTemplate` provides two variants that take -either a String URI template, or `java.net.URI` as the first argument. When using a -String URI template, encoding is automatically applied: +either a String URI template or `java.net.URI` as the first argument. When using a String +URI template, encoding is automatically applied: [source,java,indent=0] [subs="verbatim,quotes"] @@ -1150,9 +1150,9 @@ String URI template, encoding is automatically applied: ---- The resulting target URI is "http://example.com/hotel%20list". Alternatively you can -provide an already prepared `java.net.URI` and that will be used as is. -For more information on preparing URIs, or customizing how the `RestTemplate` expands -URI templates, see <> in the "Web Servlet" section. +provide an already prepared `java.net.URI` that will be used as is. For more information +on preparing URIs or customizing how the `RestTemplate` expands URI templates, see +<> in the "Web Servlet" section. [[rest-template-headers]] diff --git a/src/docs/asciidoc/web/web-uris.adoc b/src/docs/asciidoc/web/web-uris.adoc index 5f3059887cb..a02e405aa8a 100644 --- a/src/docs/asciidoc/web/web-uris.adoc +++ b/src/docs/asciidoc/web/web-uris.adoc @@ -3,7 +3,7 @@ = UriComponents `UriComponents` is comparable to `java.net.URI`. However it comes with a dedicated -`UriComponentsBuilder` and support URI template variables: +`UriComponentsBuilder` and supports URI template variables: [source,java,indent=0] [subs="verbatim,quotes"] @@ -21,7 +21,7 @@ <3> Build `UriComponents`. <4> Expand URI variables, encode, and obtain the `URI`. -The above can be done as a single chain, and with a shortcut: +The above can be done as a single chain and with a shortcut: [source,java,indent=0] [subs="verbatim,quotes"] @@ -36,8 +36,6 @@ The above can be done as a single chain, and with a shortcut: ---- - - [[web-uribuilder]] = UriBuilder @@ -46,10 +44,10 @@ The above can be done as a single chain, and with a shortcut: from a URI template, as well as a way to share common properties such as a base URI, encoding strategy, and others. -Both the `RestTemplate` and the `WebClient` can be configured with a `UriBuilderFactory`, +Both the `RestTemplate` and the `WebClient` can be configured with a `UriBuilderFactory` in order to customize how URIs are created from URI templates. The default implementation -relies on `UriComponentsBuilder` internally and provides options to a common base URI, -an alternative encoding mode strategy, and more. +relies on `UriComponentsBuilder` internally and provides options to configure a common +base URI, an alternative encoding mode strategy, and more. An example of configuring the `RestTemplate`: @@ -100,8 +98,6 @@ An example of using the `DefaultUriBuilderFactory`: ---- - - [[web-uri-encoding]] = URI Encoding @@ -121,9 +117,9 @@ The encoding in `UriComponents` is comparable to the multi-argument constructor section of its class-level Javadoc. ==== -This default way of encoding *does not* encode all characters with reserved meaning, but -only the ones that are illegal within a given URI component. If this is not what you -expect you can use an alternative. +This default encoding strategy *does not* encode all characters with reserved meaning, +but rather only the ones that are illegal within a given URI component. If this is not +what you expect you can use an alternative. When using <> you can switch to an alternative encoding strategy: @@ -140,6 +136,6 @@ encoding strategy: The above encoding strategy applies `UriUtils.encode(String, Charset)` to each URI variable value prior to expanding it. Effectively it encodes all characters with reserved -meaning, therefore ensuring that expanded URI variable do not have any impact on the +meaning, therefore ensuring that expanded URI variables do not have any impact on the structure or meaning of the URI.