{"id":19060289,"url":"https://github.com/4l3x777/ehlib","last_synced_at":"2026-05-17T19:04:10.424Z","repository":{"id":187896675,"uuid":"677771084","full_name":"4l3x777/Ehlib","owner":"4l3x777","description":"Ehlib: Embedded http(s) library","archived":false,"fork":false,"pushed_at":"2023-08-12T15:37:46.000Z","size":531,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T02:15:30.475Z","etag":null,"topics":["embedded","http","https","mbedtls","mongoose","network","tls"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/4l3x777.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-12T15:30:19.000Z","updated_at":"2024-11-28T18:42:13.000Z","dependencies_parsed_at":"2023-08-12T16:54:21.410Z","dependency_job_id":null,"html_url":"https://github.com/4l3x777/Ehlib","commit_stats":null,"previous_names":["4l3x777/ehlib"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/4l3x777/Ehlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4l3x777%2FEhlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4l3x777%2FEhlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4l3x777%2FEhlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4l3x777%2FEhlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4l3x777","download_url":"https://codeload.github.com/4l3x777/Ehlib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4l3x777%2FEhlib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33151625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded","http","https","mbedtls","mongoose","network","tls"],"created_at":"2024-11-09T00:14:20.788Z","updated_at":"2026-05-17T19:04:10.388Z","avatar_url":"https://github.com/4l3x777.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003eEHLIB: Embedded http(s) library \u003cbr\u003e\n  \u003c/h1\u003e\n\u003c/p\u003e\n\nA tiny, C++ network socket wrapper (based on [Mongoose](https://github.com/cesanta/mongoose.git) and [Mbed-TLS](https://github.com/Mbed-TLS/mbedtls.git)) for http(s) requests especially for embedded devices. Inspired by the excellent [CPR library](https://github.com/whoshuu/cpr), [WNetWrap](https://github.com/hack-tramp/WNetWrap.git), it has mostly identical function names, and will likewise work with random parameter order.\n\n## Features\n\n|Implemented| Upcoming|\n|:------------:|:----------:|\n|Custom headers|Cookie support|\n|Url encoded parameters|Self-signed Root CA support, All well-known Root CA support|\n|Multipart upload|Change default dns server|\n|File upload|Add auth proxy|\n|Custom request methods|\n|Basic authentication|\n|Bearer authentication|\n|Request timeout|\n|Non-Auth Proxy support|\n\nThat is a basic GET request - for detailed examples see the documentation below.\n\n```C++\n#include \u003ciostream\u003e\n#include \"ehlib.h\"\n    //Tested on Postman Echo\n\t//GET Request\n\tehlib::Response r = ehlib::request(\n        ehlib::RequestUrl{\"https://postman-echo.com/get\"},\n        ehlib::UrlRequestParams{\n            {\"foo1\", \"bar1\"},\n            {\"foo2\", \"bar2\"}\n        },\n        ehlib::RequestMethod{\"GET\"},\n        ehlib::RequestUserAgent{\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"}\n    );\n\n\tstd::cout \u003c\u003c r.raw \u003c\u003c std::endl; // basic parser\n\tstd::cout \u003c\u003c r.status_code \u003c\u003c std::endl; // 200\n  ```\n\n## Usage (tested on Linux \u0026 Windows)\n\n1. Just copy folders `include`, `lib` into your project.\n\n2. Add static libs and include `ehlib.h` into your build.\n\n3. That's it!\n\n## Documentation\n\nFor now it's all here on the readme, but it will eventually be put on a different page to make navigation more user friendly.\n\nTo navigate through it use the table of contents dropdown menu.\n\n### GET requests\n\nMaking a `GET` request with `Ehlib` is simple - the `GET` method is used by default so doesn't need to be specified:\n\n```C++\n#include \"ehlib.h\"\n  ehlib::Response r = ehlib::request(\n        ehlib::RequestUrl{\"https://postman-echo.com/get\"},\n        ehlib::RequestUserAgent{\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"}\n);\n```\n\nThis gives us a `Response` object which we’ve called r.\n\nThere’s a lot of useful stuff in there:\n\n```C++\n  std::cout \u003c\u003c r.url \u003c\u003c std::endl; // https://postman-echo.com/get\n\n  std::cout \u003c\u003c r.status_code \u003c\u003c   std::endl; // 200\n\n  std::cout \u003c\u003c r.header[\"Content-type\"] \u003c\u003c std::endl; // application/json; charset=utf-8\n\n  std::cout \u003c\u003c r.raw \u003c\u003c std::endl;\n\n/*\n  {\n    \"args\": {},\n    \"headers\": {\n      \"x-forwarded-proto\": \"https\",\n      \"x-forwarded-port\": \"443\",\n      \"host\": \"postman-echo.com\",\n      \"x-amzn-trace-id\": \"Root=1-64d67257-24fc86582562e80206287bbe\",\n      \"content-length\": \"0\",\n      \"user-agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"\n    },\n    \"url\": \"https://postman-echo.com/get\"\n  }\n*/\n```\n\nTo add URL-encoded parameters, add a `UrlRequestParams` object to the `request` call:\n\n```C++\n  auto r = ehlib::request(\n        ehlib::RequestUrl{\"https://postman-echo.com/get\"},\n        ehlib::UrlRequestParams{\n            {\"foo1\", \"bar1\"},\n            {\"foo2\", \"bar2\"}\n        },\n        ehlib::RequestUserAgent{\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"}\n  );\n\n  std::cout \u003c\u003c r.url \u003c\u003c std::endl; // https://postman-echo.com/get?foo1=bar1\u0026foo2=bar2\n  std::cout \u003c\u003c r.raw \u003c\u003c std::endl;\n\n/*\n  {\n    \"args\": {\n      \"foo1\": \"bar1\",\n      \"foo2\": \"bar2\"\n    },\n    \"headers\": {\n      \"x-forwarded-proto\": \"https\",\n      \"x-forwarded-port\": \"443\",\n      \"host\": \"postman-echo.com\",\n      \"x-amzn-trace-id\": \"Root=1-64d674e0-26f038a10e869e521dcdbfdc\",\n      \"content-length\": \"0\",\n      \"user-agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"\n    },\n    \"url\": \"https://postman-echo.com/get?foo1=bar1\u0026foo2=bar2\"\n  }\n*/\n```\n\n`UrlRequestParams` is an object with a map-like interface.\n\nYou can construct it using a list of key/value pairs inside the `request` or have it outlive `request` by constructing it outside:\n\n```C++\n// Constructing it in a place\n  auto r = ehlib::request(\n      ehlib::RequestUrl{\"http://www.httpbin.org/get\"},\n      ehlib::UrlRequestParams{\n        {\"foo1\", \"bar1\"},\n        {\"foo2\", \"bar2\"}\n      },\n      ehlib::RequestUserAgent{\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"}\n  );\n\n  std::cout \u003c\u003c r.url \u003c\u003c std::endl; // https://postman-echo.com/get?foo1=bar1\u0026foo2=bar2\n\n  std::cout \u003c\u003c r.raw \u003c\u003c std::endl;\n\n/*\n  {\n    \"args\": {\n      \"foo1\": \"bar1\",\n      \"foo2\": \"bar2\"\n    },\n    \"headers\": {\n      \"x-forwarded-proto\": \"https\",\n      \"x-forwarded-port\": \"443\",\n      \"host\": \"postman-echo.com\",\n      \"x-amzn-trace-id\": \"Root=1-64d67627-0f91d09203e69af636c8fcfb\",\n      \"content-length\": \"0\",\n      \"user-agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"\n    },\n    \"url\": \"https://postman-echo.com/get?foo1=bar1\u0026foo2=bar2\"\n  }\n*/\n\n // Constructing it an outside\n  auto parameters = ehlib::UrlRequestParams{\n    {\"foo1\", \"bar1\"},\n    {\"foo2\", \"bar2\"}\n  };\n\n  auto r_outside = ehlib::request(\n    ehlib::RequestUrl{\"https://postman-echo.com/get\"},\n    parameters\n  );\n\n  std::cout \u003c\u003c r_outside.url \u003c\u003c std::endl; // https://postman-echo.com/get?foo1=bar1\u0026foo2=bar2\n\n  std::cout \u003c\u003c r_outside.raw \u003c\u003c std::endl; // Same text response as above\n```\n\n### Download a file\n\nTo download the contents of the request you simply add `RequestUrl` to `request`.\n\nFile content will return into Response's `raw` field.\n\nFor example, to download the CPR library:\n\n```C++\n  auto r = ehlib::request(\n      ehlib::RequestUrl{ \"https://github.com/whoshuu/cpr/archive/refs/tags/1.10.4.zip\" },\n      ehlib::RequestUserAgent{\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"}\n  );\n\n  std::cout \u003c\u003c r.raw \u003c\u003c std::endl; // print donwloaded file's content (our 1.10.4.zip archive bytes)\n```\n\n### POST Requests\n\nMaking a POST request must use `RequestMethod`:\n\n```C++\n  auto r = ehlib::request(\n        ehlib::RequestUrl{\"https://postman-echo.com/post\"},\n        ehlib::RequestMethod{\"POST\"}\n  );\n\n  std::cout \u003c\u003c r.text \u003c\u003c std::endl;\n\n/*\n  {\n    \"args\": {},\n    \"data\": {},\n    \"files\": {},\n    \"form\": {},\n    \"headers\": {\n      \"x-forwarded-proto\": \"https\",\n      \"x-forwarded-port\": \"443\",\n      \"host\": \"postman-echo.com\",\n      \"x-amzn-trace-id\": \"Root=1-64d688e8-1a56cc76092b9abd7de205d9\",\n      \"content-length\": \"0\",\n      \"user-agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"\n    },\n    \"json\": null,\n    \"url\": \"https://postman-echo.com/post\"\n  }\n*/\n```\n\nThis sends some data `\"This is raw POST data\"` with use `PostRequestBody`:\n\n```C++\n  auto r = ehlib::request(\n        ehlib::RequestUrl{\"https://postman-echo.com/post\"},\n        ehlib::PostRequestBody{\"This is raw POST data\"},\n        ehlib::RequestMethod{\"POST\"}\n  );\n\n  std::cout \u003c\u003c r.text \u003c\u003c std::endl;\n\n/*\n  {\n    \"args\": {},\n    \"data\": \"This is raw POST data\",\n    \"files\": {},\n    \"form\": {},\n    \"headers\": {\n      \"x-forwarded-proto\": \"https\",\n      \"x-forwarded-port\": \"443\",\n      \"host\": \"postman-echo.com\",\n      \"x-amzn-trace-id\": \"Root=1-64d689c1-3a281bae0158913d6a4f240a\",\n      \"content-length\": \"21\",\n      \"user-agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\",\n      \"content-type\": \"application/json\"\n    },\n    \"json\": null,\n    \"url\": \"https://postman-echo.com/post\"\n  }\n*/\n```\n\nIf the data package is large or contains a file, it’s more appropriate to use a `RequestMultipartUpload` upload.\n\nIn this example we are uploading a text files to `https://postman-echo.com/post`:\n\n```C++\n  auto r = ehlib::request(\n        ehlib::RequestUrl{\"https://postman-echo.com/post\"},\n        ehlib::RequestMultipartUpload{\n            {\"file_path:1.txt\", \"1.txt\"},\n            {\"file_path:C:/Windows/win.ini\", \"win.ini\"},\n            {\"some raw data\", \"2.txt\"}\n        },\n\t\tehlib::RequestMethod{\"POST\"}\n  );\n\n  std::cout \u003c\u003c r.text \u003c\u003c std::endl;\n\n/*\n  {\n    \"args\": {},\n    \"data\": {},\n    \"files\": {\n      \"1.txt\": \"data:application/octet-stream;base64,aGVsbG8gd29ybGQh\",\n      \"win.ini\": \"data:application/octet-stream;base64,OyBmb3IgMTYtYml0IGFwcCBzdXBwb3J0DQpbZm9udHNdDQpbZXh0ZW5zaW9uc10NClttY2kgZXh0ZW5zaW9uc10NCltmaWxlc10NCltNYWlsXQ0KTUFQST0xDQo=\"\n    },\n    \"form\": {\n      \"some raw data\": \"2.txt\"\n    },\n    \"headers\": {\n      \"x-forwarded-proto\": \"https\",\n      \"x-forwarded-port\": \"443\",\n      \"host\": \"postman-echo.com\",\n      \"x-amzn-trace-id\": \"Root=1-64d68e5f-0e0b852e32702ddc7806ff31\",\n      \"content-length\": \"513\",\n      \"content-type\": \"multipart/form-data; boundary=1816741701207515830740325151\",\n      \"user-agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"\n    },\n    \"json\": null,\n    \"url\": \"https://postman-echo.com/post\"\n  }\n*/\n```\n\nNotice `file_path:` prefix - this tells that is file on disk and not a key - value pair as form `{\"some raw data\", \"2.txt\"}`.\n\n### Authentication\n\nTo use [Basic Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) which uses a username and password, just add `BasicAuth` to the call:\n\n```C++\n  auto r = ehlib::request(\n        ehlib::RequestUrl{\"https://postman-echo.com/basic-auth\"},\n        ehlib::BasicAuth {\"postman\", \"password\"},\n\t\tehlib::RequestMethod{\"GET\"}\n    );\n\n  std::cout \u003c\u003c r.text \u003c\u003c std::endl;\n\n/*\n  {\n    \"authenticated\": true\n  }\n*/\n\n```\n\nAuthentication via an [OAuth - Bearer Token](https://en.wikipedia.org/wiki/OAuth) can be done using the `BearerAuth` authentication object:\n\n```C++\n  auto r = ehlib::request(\n        ehlib::RequestUrl{\"http://www.httpbin.org/bearer\"},\n        ehlib::BearerAuth {\"ACCESS_TOKEN\"},\n        ehlib::RequestMethod{\"GET\"}\n  );\nstd::cout \u003c\u003c r.text \u003c\u003c std::endl;\n\n/*\n  {\n    \"authenticated\": true,\n    \"token\": \"ACCESS_TOKEN\"\n  }\n*/\n\n```\n\n### Response Objects\n\nA `Response` has these public fields and methods:\n```C++\nstd::string status_code;        // The HTTP(S) status code for the request\nstd::string raw;                // The data of the HTTP response\nstd::map header;                // A map of the header fields received\nstd::map sent_headers;          // A map of the headers sent\nstd::string url;                // The effective URL of the ultimate request\nstd::string err;                // An error string containing the error code and a message\nunsigned long uploaded_bytes;   // How many bytes have been sent to the server\nunsigned long downloaded_bytes; // How many bytes have been received from the server\nunsigned long redirect_count;   // How many redirects occurred\nvoid reset(); // Reset Response object to default state\n```\n\n### Request Headers\n\nUsing `RequestHeaders` in your `request` you can specify custom headers:\n\n```C++\n  auto r = ehlib::request(\n        ehlib::RequestUrl{\"https://postman-echo.com/get\"},\n        ehlib::RequestHeaders{\n            {\"accept\", \"application/json\"},\n            {\"master\", \"slave\"}\n        },\n        ehlib::RequestMethod{\"GET\"},\n        ehlib::RequestUserAgent{\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"}\n  );\n\n  std::cout \u003c\u003c r.text \u003c\u003c std::endl;\n\n/*\n  {\n    \"args\": {},\n    \"headers\": {\n      \"x-forwarded-proto\": \"https\",\n      \"x-forwarded-port\": \"443\",\n      \"host\": \"postman-echo.com\",\n      \"x-amzn-trace-id\": \"Root=1-64d6950a-387220f76b21c06865853326\",\n      \"content-length\": \"0\",\n      \"accept\": \"application/json\",\n      \"master\": \"slave\",\n      \"user-agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"\n    },\n    \"url\": \"https://postman-echo.com/get\"\n  }\n*/\n\n```\n\n### Timeouts\n\nIt’s possible to set a timeout for your request if you have strict timing requirements:\n\n```C++\n\tauto r = ehlib::request(\n        ehlib::RequestUrl{\"https://postman-echo.com/get\"},\n        ehlib::RequestTimeout{ 10 },\n        ehlib::RequestMethod{\"GET\"},\n        ehlib::RequestUserAgent{\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"}\n    );\n\n  std::cout \u003c\u003c r.text \u003c\u003c std::endl; // Connection timeout\n```\n\nSetting the `RequestTimeout` option sets the maximum allowed time the connection or request operation can take in milliseconds. By default a `RequestTimeout` set in 5000 milliseconds\n\n### Using Proxies\n\nSetting up a proxy is easy. For example, we have tor `http proxy` on `localhost` port `9080`.\nTry to connect to `https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/`.\nThis is official `duckduckgo.com` .onion mirror. To do this we will use `RequestProxy`.\n\n```C++\n  auto r = ehlib::request(\n        ehlib::RequestUrl{\"https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/\"},\n        ehlib::RequestTimeout{ 100000 },\n        ehlib::RequestProxy{ \"http://127.0.0.1:9080\"},\n        ehlib::RequestMethod{\"GET\"},\n        ehlib::RequestUserAgent{\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"}\n  );\n\n  std::cout \u003c\u003c r.raw \u003c\u003c std::endl; \n  \n  /*\n  \u003c!DOCTYPE html\u003e\\n\u003c!--[if IEMobile 7 ]\u003e \u003chtml lang=\\\"en-US\\\" class=\\\"no-js iem7\\\"\u003e \u003c![endif]--\u003e\\n\u003c!--[if lt IE 7]\u003e \u003chtml class=\\\"ie6 lt-ie10 lt-ie9 lt-ie8 lt-ie7 no-js\\\" lang=\\\"en-US\\\"\u003e \u003c![endif]--\u003e\\n\u003c!--[if IE 7]\u003e    \u003chtml class=\\\"ie7 lt-ie10 lt-ie9 lt-ie8 no-js\\\" lang=\\\"en-US\\\"\u003e \u003c![endif]--\u003e\\n\u003c!--[if IE 8]\u003e    \u003chtml class=\\\"ie8 lt-ie10 lt-ie9 no-js\\\" lang=\\\"en-US\\\"\u003e \u003c![endif]--\u003e\\n\u003c!--[if IE 9]\u003e    \u003chtml class=\\\"ie9 lt-ie10 no-js\\\" lang=\\\"en-US\\\"\u003e \u003c![endif]--\u003e\\n\u003c!--[if (gte IE 9)|(gt IEMobile 7)|!(IEMobile)|!(IE)]\u003e\u003c!--\u003e\u003chtml class=\\\"no-js\\\" lang=\\\"en-US\\\" data-ntp-features=\\\"tracker-stats-widget:off\\\"\u003e\u003c!--\u003c![endif]--\u003e\\n\\n\u003chead\u003e\\n\\t\u003cmeta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=Edge\\\" /\u003e\\n\u003cmeta http-equiv=\\\"content-type\\\" content=\\\"text/html; charset=UTF-8;charset=utf-8\\\"\u003e\\n\u003cmeta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1, user-scalable=1\\\" /\u003e\\n\u003cmeta name=\\\"HandheldFriendly\\\" content=\\\"true\\\"/\u003e\\n\u003cmeta name=\\\"darkreader-lock\\\" /\u003e\\n\\n\u003clink rel=\\\"canonical\\\" href=\\\"https://duckduckgo.com/duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion\\\"\u003e\\n\\n\u003clink rel=\\\"stylesheet\\\" ...\u003c/html\u003e\\n\n*/\n```\n\n### Additional Options\n\n|Allowed options| Upcoming|\n|:------------:|:----------:|\n|auto-redirect (on/off)|?|\n\n\nThe `RequestOptions` constructor allows you to specify additional options for the request. For example, turn `off` auto-redirects (default: `auto-redirect` turn `on`). To enable the option you can use `on`.\n\n```C++\n\tauto r = ehlib::request(\n        ehlib::RequestUrl{\"http://ya.ru\"},\n        ehlib::RequestOptions { \n            {\"auto-redirect\", \"off\"}\n        },\n        ehlib::RequestUserAgent{\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36\"}\n  );\n\n  std::cout \u003c\u003c r.status_code \u003c\u003c std::endl; // 301\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4l3x777%2Fehlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4l3x777%2Fehlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4l3x777%2Fehlib/lists"}