Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
1513e7be
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1513e7be
编写于
2月 16, 2018
作者:
S
Sam Brannen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
8d3264f6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
18 deletion
+14
-18
src/docs/asciidoc/integration.adoc
src/docs/asciidoc/integration.adoc
+5
-5
src/docs/asciidoc/web/web-uris.adoc
src/docs/asciidoc/web/web-uris.adoc
+9
-13
未找到文件。
src/docs/asciidoc/integration.adoc
浏览文件 @
1513e7be
...
...
@@ -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
<
<
web.adoc#mvc-uri-building
,
URI
Links
>
> 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
<
<
web.adoc#mvc-uri-building
,
URI
Links
>
> in the "Web Servlet" section.
[[rest-template-headers]]
...
...
src/docs/asciidoc/web/web-uris.adoc
浏览文件 @
1513e7be
...
...
@@ -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 support
s
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 <<web-uribuilder,DefaultUriBuilderFactory>> 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 variable
s
do not have any impact on the
structure or meaning of the URI.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录