WebClient 软件包是 RT-Thread 自主研发的,基于 HTTP 协议的客户端的实现,它提供设备与 HTTP Server 的通讯的基本功能。
## 1. Introduction
WebClient 软件包功能特点如下:
The WebClient software package is independently developed by RT-Thread and is based on the implementation of the HTTP protocol client. It provides the basic functions of communication between the device and the HTTP Server.
- 支持 IPV4/IPV6 地址;
The features of the WebClient software package are as follows:
- 支持 GET/POST 请求方法;
- 支持文件的上传和下载功能;
- 支持 HTTPS 加密传输;
- 完善的头部数据添加和处理方式。
更多软件包介绍请查看 [详细介绍](docs/introduction.md)。
- Support IPV4/IPV6 address;
- Support GET/POST request method;
- Support file upload and download function;
- Support HTTPS encrypted transmission;
- Complete header data addition and processing methods.
### 1.1 目录结构
For more software package introduction, please refer to [Detailed introduction](docs/introduction.md).
WebClient 软件包目录结构如下所示:
### 1.1 Directory structure
The directory structure of the WebClient software package is as follows:
```
```
webclient
webclient
├───docs
├───docs
│ └───figures // 文档使用图片
│ └───figures // Documents use pictures
│ │ api.md // API 使用说明
│ │ api.md // API instructions
│ │ introduction.md // 介绍文档
│ │ introduction.md // Introduction document
│ │ principle.md // 实现原理
│ │ principle.md // Implementation principle
│ │ README.md // 文档结构说明
│ │ README.md // Document structure description
│ │ samples.md // 软件包示例
│ │ samples.md // package sample
│ │ user-guide.md // 使用说明
│ │ user-guide.md // Instructions
│ └───version.md // 版本
│ └───version.md // version
├───inc // 头文件
├───inc // header file
├───src // 源文件
├───src // source file
├───samples // 示例代码
├───samples // sample code
| | webclient_get_sample // GET 请求示例代码
| | webclient_get_sample // GET request sample code
│ └───webclient_post_sample // POST 请求示例代码
│ └───webclient_post_sample // POST request sample code
│ LICENSE // 软件包许可证
│ LICENSE // package license
│ README.md // 软件包使用说明
│ README.md // Software package instructions
└───SConscript // RT-Thread 默认的构建脚本
└───SConscript // RT-Thread default build script
```
```
### 1.2 许可证
### 1.2 License
WebClient 软件包遵循 Apache-2.0 许可,详见 LICENSE 文件。
The WebClient software package complies with the Apache-2.0 license, see the LICENSE file for details.
**Select TLS mode**: Configure to enable HTTPS support and select the supported mode;
- 软件包详细介绍,请参考 [软件包介绍](docs/introduction.md)
- 详细的示例介绍,请参考 [示例文档](docs/samples.md)
- **Not support**: Does not support TLS function;
- **SAL TLS support**: Configure the TLS function support in the SAL component, and abstract the TLS operation in the SAL component. Users also need to **manually configure the type of TLS software package used** (currently only supports the MbedTLS package);
- **MbedTLS support**: configure MbedTLS function support;
- 如何从零开始使用,请参考 [用户指南](docs/user-guide.md)
**Version**: Configure the software package version.
- 完整的 API 文档,请参考 [API 手册](docs/api.md)
After the configuration is complete, let the RT-Thread package manager automatically update, or use the pkgs --update command to update the package to the BSP.
- 软件包工作原理,请参考 [工作原理](docs/principle.md)
## 3. Use WebClient software package
- For detailed description of the software package, please refer to [Package Introduction](docs/introduction.md)
- For detailed sample introduction, please refer to [Sample Document](docs/samples.md)
- How to use from scratch, please refer to [User Guide](docs/user-guide.md)
- For complete API documentation, please refer to [API Manual](docs/api.md)
- The working principle of the software package, please refer to [Working Principle](docs/principle.md)
- After the WebClient software package version update (`V1.0.0 -> the current latest version V2.0.0`), the function interface and usage process in the software package have changed. If the previous interface is used in the developer code, the latest version interface can be adapted , Or select the `V1.0.0` version in the version number configuration, the specific modification method can refer to the software package [migration guide](docs/migration-guide.md).