@@ -23,6 +23,7 @@ Modern, non-blocking and exception free, header-only HTTP Client library for C++
23
23
* [ POST request with form data] ( #post-request-with-form-data )
24
24
* [ POST request with JSON data] ( #post-request-with-json-data )
25
25
* [ What about others? (PUT, DELETE, PATCH)] ( #what-about-others-put-delete-patch )
26
+ * [ How to ignore SSL certificate errors?] ( #how-to-ignore-ssl-certificate-errors )
26
27
* [ Semantic Versioning] ( #semantic-versioning )
27
28
* [ Full function list] ( #full-function-list )
28
29
* [ License] ( #license )
@@ -336,6 +337,32 @@ int main() {
336
337
```
337
338
338
339
340
+ ## How to ignore SSL certificate errors?
341
+
342
+ If you need to ignore SSL certificate errors for any valid reason, you can continue
343
+ working by passing ** "true"** value to the ** "ignoreSslErrors"** variable of the
344
+ HttpClient class.
345
+
346
+ ``` cpp
347
+ #include < fstream>
348
+ #include " libcpp-http-client.hpp"
349
+
350
+ using namespace lklibs ;
351
+
352
+ int main () {
353
+
354
+ HttpClient httpClient;
355
+
356
+ // If you need to ignore SSL errors, you can set the "ignoreSslErrors" field to true
357
+ httpClient.ignoreSslErrors = true;
358
+
359
+ auto response = httpClient.getRequest("https://api.myinvalidssl.com").get();
360
+
361
+ return 0;
362
+ }
363
+ ```
364
+
365
+
339
366
## Semantic Versioning
340
367
341
368
Versioning of the library is done using conventional semantic versioning. Accordingly,
@@ -363,49 +390,49 @@ overloaded versions of 5 functions in total.
363
390
``` cpp
364
391
- getRequest
365
392
- std::future<HttpResult> getRequest (const std::string &url)
366
- - std::future<HttpResult > getRequest(const std::string &url, bool returnAsBinary)
367
- - std::future<HttpResult > getRequest(const std::string &url, const std::map<std::string, std::string> &headers)
368
- - std::future<HttpResult > getRequest(const std::string &url, bool returnAsBinary, const std::map<std::string, std::string> &headers)
393
+ - std::future<HttpResult > getRequest(const std::string &url, bool returnAsBinary, bool ignoreSslErrors = false )
394
+ - std::future<HttpResult > getRequest(const std::string &url, const std::map<std::string, std::string> &headers, bool ignoreSslErrors = false )
395
+ - std::future<HttpResult > getRequest(const std::string &url, bool returnAsBinary, const std::map<std::string, std::string> &headers, bool ignoreSslErrors = false )
369
396
370
397
371
398
- postRequest
372
399
- std::future<HttpResult > postRequest(const std::string &url)
373
- - std::future<HttpResult > postRequest(const std::string &url, const std::string &payload)
374
- - std::future<HttpResult > postRequest(const std::string &url, bool returnAsBinary)
375
- - std::future<HttpResult > postRequest(const std::string &url, const std::map<std::string, std::string> &headers)
376
- - std::future<HttpResult > postRequest(const std::string &url, const std::string &payload, bool returnAsBinary)
377
- - std::future<HttpResult > postRequest(const std::string &url, const std::string &payload, const std::map<std::string, std::string> &headers)
378
- - std::future<HttpResult > postRequest(const std::string &url, bool returnAsBinary, const std::map<std::string, std::string> &headers)
379
- - std::future<HttpResult > postRequest(const std::string &url, const std::string &payload, bool returnAsBinary, const std::map<std::string, std::string> &headers)
400
+ - std::future<HttpResult > postRequest(const std::string &url, const std::string &payload, bool ignoreSslErrors = false )
401
+ - std::future<HttpResult > postRequest(const std::string &url, bool returnAsBinary, bool ignoreSslErrors = false )
402
+ - std::future<HttpResult > postRequest(const std::string &url, const std::map<std::string, std::string> &headers, bool ignoreSslErrors = false )
403
+ - std::future<HttpResult > postRequest(const std::string &url, const std::string &payload, bool returnAsBinary, bool ignoreSslErrors = false )
404
+ - std::future<HttpResult > postRequest(const std::string &url, const std::string &payload, const std::map<std::string, std::string> &headers, bool ignoreSslErrors = false )
405
+ - std::future<HttpResult > postRequest(const std::string &url, bool returnAsBinary, const std::map<std::string, std::string> &headers, bool ignoreSslErrors = false )
406
+ - std::future<HttpResult > postRequest(const std::string &url, const std::string &payload, bool returnAsBinary, const std::map<std::string, std::string> &headers, bool ignoreSslErrors = false )
380
407
381
408
382
409
- putRequest
383
410
- std::future<HttpResult > putRequest(const std::string &url)
384
- - std::future<HttpResult > putRequest(const std::string &url, const std::string &payload)
385
- - std::future<HttpResult > putRequest(const std::string &url, bool returnAsBinary)
386
- - std::future<HttpResult > putRequest(const std::string &url, const std::map<std::string, std::string> &headers)
387
- - std::future<HttpResult > putRequest(const std::string &url, const std::string &payload, bool returnAsBinary)
388
- - std::future<HttpResult > putRequest(const std::string &url, const std::string &payload, const std::map<std::string, std::string> &headers)
389
- - std::future<HttpResult > putRequest(const std::string &url, bool returnAsBinary, const std::map<std::string, std::string> &headers)
390
- - std::future<HttpResult > putRequest(const std::string &url, const std::string &payload, bool returnAsBinary, const std::map<std::string, std::string> &headers)
411
+ - std::future<HttpResult > putRequest(const std::string &url, const std::string &payload, bool ignoreSslErrors = false )
412
+ - std::future<HttpResult > putRequest(const std::string &url, bool returnAsBinary, bool ignoreSslErrors = false )
413
+ - std::future<HttpResult > putRequest(const std::string &url, const std::map<std::string, std::string> &headers, bool ignoreSslErrors = false )
414
+ - std::future<HttpResult > putRequest(const std::string &url, const std::string &payload, bool returnAsBinary, bool ignoreSslErrors = false )
415
+ - std::future<HttpResult > putRequest(const std::string &url, const std::string &payload, const std::map<std::string, std::string> &headers, bool ignoreSslErrors = false )
416
+ - std::future<HttpResult > putRequest(const std::string &url, bool returnAsBinary, const std::map<std::string, std::string> &headers, bool ignoreSslErrors = false )
417
+ - std::future<HttpResult > putRequest(const std::string &url, const std::string &payload, bool returnAsBinary, const std::map<std::string, std::string> &headers, bool ignoreSslErrors = false )
391
418
392
419
393
420
- deleteRequest
394
421
- std::future<HttpResult > deleteRequest(const std::string &url)
395
- - std::future<HttpResult > deleteRequest(const std::string &url, const std::string &payload)
396
- - std::future<HttpResult > deleteRequest(const std::string &url, bool returnAsBinary)
397
- - std::future<HttpResult > deleteRequest(const std::string &url, const std::map<std::string, std::string> &headers)
398
- - std::future<HttpResult > deleteRequest(const std::string &url, const std::string &payload, bool returnAsBinary)
399
- - std::future<HttpResult > deleteRequest(const std::string &url, const std::string &payload, const std::map<std::string, std::string> &headers)
400
- - std::future<HttpResult > deleteRequest(const std::string &url, bool returnAsBinary, const std::map<std::string, std::string> &headers)
401
- - std::future<HttpResult > deleteRequest(const std::string &url, const std::string &payload, bool returnAsBinary, const std::map<std::string, std::string> &headers)
422
+ - std::future<HttpResult > deleteRequest(const std::string &url, const std::string &payload, bool ignoreSslErrors = false )
423
+ - std::future<HttpResult > deleteRequest(const std::string &url, bool returnAsBinary, bool ignoreSslErrors = false )
424
+ - std::future<HttpResult > deleteRequest(const std::string &url, const std::map<std::string, std::string> &headers, bool ignoreSslErrors = false )
425
+ - std::future<HttpResult > deleteRequest(const std::string &url, const std::string &payload, bool returnAsBinary, bool ignoreSslErrors = false )
426
+ - std::future<HttpResult > deleteRequest(const std::string &url, const std::string &payload, const std::map<std::string, std::string> &headers, bool ignoreSslErrors = false )
427
+ - std::future<HttpResult > deleteRequest(const std::string &url, bool returnAsBinary, const std::map<std::string, std::string> &headers, bool ignoreSslErrors = false )
428
+ - std::future<HttpResult > deleteRequest(const std::string &url, const std::string &payload, bool returnAsBinary, const std::map<std::string, std::string> &headers, bool ignoreSslErrors = false )
402
429
403
430
404
431
- patchRequest
405
432
- std::future<HttpResult > patchRequest(const std::string &url)
406
- - std::future<HttpResult > patchRequest(const std::string &url, bool returnAsBinary)
407
- - std::future<HttpResult > patchRequest(const std::string &url, const std::map<std::string, std::string> &headers)
408
- - std::future<HttpResult > patchRequest(const std::string &url, bool returnAsBinary, const std::map<std::string, std::string> &headers)
433
+ - std::future<HttpResult > patchRequest(const std::string &url, bool returnAsBinary, bool ignoreSslErrors = false )
434
+ - std::future<HttpResult > patchRequest(const std::string &url, const std::map<std::string, std::string> &headers, bool ignoreSslErrors = false )
435
+ - std::future<HttpResult > patchRequest(const std::string &url, bool returnAsBinary, const std::map<std::string, std::string> &headers, bool ignoreSslErrors = false )
409
436
```
410
437
411
438
0 commit comments