100-expect-continue
RestClient
的100-expect-continue
功能通过底层的HttpClient
来实现,可以分别支持 Client 级别 及 Request 级别。默认100-expect-continue
为false。Client级别100-expect-continue
Client级别的100-expect-continue
将对该Client下的所有 Request 生效,具体配置方式如下:
final RestClient client = RestClient.create()
.useExpectContinue(true)
.build();
Request级别100-expect-continue
当Request设置了100-expect-continue
,其数据将覆盖Client设置的100-expect-continue
,具体配置方式如下:
final String entity = client.get("http://127.0.0.1:8081/")
.disableExpectContinue()
.execute()
.toCompletableFuture()
.get()
.bodyToEntity(String.class);
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified February 22, 2022: add more docs (f7f7447)