Skip to content

Commit c67d701

Browse files
committed
Documentation has been updated for setTLSVersion method
1 parent 16e29b9 commit c67d701

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Modern, non-blocking and exception free, header-only HTTP Client library for C++
2424
* [POST request with JSON data](#post-request-with-json-data)
2525
* [What about others? (PUT, DELETE, PATCH)](#what-about-others-put-delete-patch)
2626
* [How to ignore SSL certificate errors?](#how-to-ignore-ssl-certificate-errors)
27+
* [Setting the TLS version](#setting-the-tls-version)
2728
* [How to set timeout?](#how-to-set-timeout)
2829
* [How can I limit download and upload bandwidth?](#how-can-i-limit-download-and-upload-bandwidth)
2930
* [Semantic Versioning](#semantic-versioning)
@@ -388,6 +389,31 @@ int main() {
388389
}
389390
```
390391

392+
393+
## Setting the TLS version
394+
395+
You can set the TLS version used during the request with the setTLSVersion method
396+
397+
```cpp
398+
#include <fstream>
399+
#include "libcpp-http-client.hpp"
400+
401+
using namespace lklibs;
402+
403+
int main() {
404+
HttpRequest httpRequest("https://api.myproject.com");
405+
406+
// You can set the TLS version to be used for the request with setTLSVersion method
407+
auto response = httpRequest
408+
.setTLSVersion(TLSVersion::TLSv1_3)
409+
.send()
410+
.get();
411+
412+
return 0;
413+
}
414+
```
415+
416+
391417
## How to set timeout?
392418

393419
You can use the setTimeout method to set the timeout duration in seconds during requests.

0 commit comments

Comments
 (0)