From 32fa849197884904b68a46e7c023036e28b0f90f Mon Sep 17 00:00:00 2001 From: fawdlstty Date: Sun, 15 May 2022 00:12:06 +0800 Subject: [PATCH] update doc global config order --- docs/en_us/0_Startup.md | 13 ++++++++++++- docs/en_us/1_HttpClient.md | 13 ------------- docs/zh_hans/0_Startup.md | 13 ++++++++++++- docs/zh_hans/1_HttpClient.md | 13 ------------- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/docs/en_us/0_Startup.md b/docs/en_us/0_Startup.md index 15f8175..f8d379b 100644 --- a/docs/en_us/0_Startup.md +++ b/docs/en_us/0_Startup.md @@ -64,4 +64,15 @@ fv::Tasks::RunAsync (async_func); fv::Tasks::RunAsync (async_func2, 5); ``` -Now that we have created the asynchronous function environment, we can write asynchronous code in it. +## Global configuration Settings + +```cpp +// Set SSL verification function (default no verification) +fv::Config::SslVerifyFunc = [] (bool preverified, fv::Ssl::verify_context &ctx) { return true; }; + +// Setting global TCP transmission without delay (Used in scenarios requiring high real-time performance) +fv::Config::NoDelay = true; + +// Setting the global HTTP header (client) +fv::Request::SetDefaultHeader ("User-Agent", "libfv-0.0.1"); +``` diff --git a/docs/en_us/1_HttpClient.md b/docs/en_us/1_HttpClient.md index a2db5da..5096fdf 100644 --- a/docs/en_us/1_HttpClient.md +++ b/docs/en_us/1_HttpClient.md @@ -1,18 +1,5 @@ # HTTP Client -## Global configuration Settings - -```cpp -// Set SSL verification function (default no verification) -fv::Config::SslVerifyFunc = [] (bool preverified, fv::Ssl::verify_context &ctx) { return true; }; - -// Setting global TCP transmission without delay (Used in scenarios requiring high real-time performance) -fv::Config::NoDelay = true; - -// Setting the global HTTP header (client) -fv::Request::SetDefaultHeader ("User-Agent", "libfv-0.0.1"); -``` - ## Launch request A total of six HTTP requests are supported. You can use `fv::Head`、`fv::Option`、`fv::Get`、`fv::Post`、`fv::Put`、`fv::Delete` methods. diff --git a/docs/zh_hans/0_Startup.md b/docs/zh_hans/0_Startup.md index 7f26436..f37c7eb 100644 --- a/docs/zh_hans/0_Startup.md +++ b/docs/zh_hans/0_Startup.md @@ -64,4 +64,15 @@ fv::Tasks::RunAsync (async_func); fv::Tasks::RunAsync (async_func2, 5); ``` -现在我们已经创建好了异步函数环境,可以自由在里面编写异步代码啦! +## 全局配置设置 + +```cpp +// 设置SSL校验函数(默认不校验) +fv::Config::SslVerifyFunc = [] (bool preverified, fv::Ssl::verify_context &ctx) { return true; }; + +// 设置全局TCP不延迟发送(对实时性要求较高场合使用) +fv::Config::NoDelay = true; + +// 设置全局 http 头 +fv::Request::SetDefaultHeader ("User-Agent", "libfv-0.0.1"); +``` diff --git a/docs/zh_hans/1_HttpClient.md b/docs/zh_hans/1_HttpClient.md index 3299921..de3e531 100644 --- a/docs/zh_hans/1_HttpClient.md +++ b/docs/zh_hans/1_HttpClient.md @@ -1,18 +1,5 @@ # HTTP 客户端 -## 全局配置设置 - -```cpp -// 设置SSL校验函数(默认不校验) -fv::Config::SslVerifyFunc = [] (bool preverified, fv::Ssl::verify_context &ctx) { return true; }; - -// 设置全局TCP不延迟发送(对实时性要求较高场合使用) -fv::Config::NoDelay = true; - -// 设置全局 http 头 -fv::Request::SetDefaultHeader ("User-Agent", "libfv-0.0.1"); -``` - ## 发起请求 共支持6种HTTP请求,可使用 `fv::Head`、`fv::Option`、`fv::Get`、`fv::Post`、`fv::Put`、`fv::Delete` 方法。