http_examples.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. #include <http_client.h>
  2. #include <aos/kernel.h>
  3. #include <aos/debug.h>
  4. #define TAG "https_example"
  5. static char ca_crt_rsa[] = {
  6. "-----BEGIN CERTIFICATE-----\r\n"
  7. "MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/\r\n"
  8. "MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT\r\n"
  9. "DkRTVCBSb290IENBIFgzMB4XDTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0Nlow\r\n"
  10. "SjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQxIzAhBgNVBAMT\r\n"
  11. "GkxldCdzIEVuY3J5cHQgQXV0aG9yaXR5IFgzMIIBIjANBgkqhkiG9w0BAQEFAAOC\r\n"
  12. "AQ8AMIIBCgKCAQEAnNMM8FrlLke3cl03g7NoYzDq1zUmGSXhvb418XCSL7e4S0EF\r\n"
  13. "q6meNQhY7LEqxGiHC6PjdeTm86dicbp5gWAf15Gan/PQeGdxyGkOlZHP/uaZ6WA8\r\n"
  14. "SMx+yk13EiSdRxta67nsHjcAHJyse6cF6s5K671B5TaYucv9bTyWaN8jKkKQDIZ0\r\n"
  15. "Z8h/pZq4UmEUEz9l6YKHy9v6Dlb2honzhT+Xhq+w3Brvaw2VFn3EK6BlspkENnWA\r\n"
  16. "a6xK8xuQSXgvopZPKiAlKQTGdMDQMc2PMTiVFrqoM7hD8bEfwzB/onkxEz0tNvjj\r\n"
  17. "/PIzark5McWvxI0NHWQWM6r6hCm21AvA2H3DkwIDAQABo4IBfTCCAXkwEgYDVR0T\r\n"
  18. "AQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYwfwYIKwYBBQUHAQEEczBxMDIG\r\n"
  19. "CCsGAQUFBzABhiZodHRwOi8vaXNyZy50cnVzdGlkLm9jc3AuaWRlbnRydXN0LmNv\r\n"
  20. "bTA7BggrBgEFBQcwAoYvaHR0cDovL2FwcHMuaWRlbnRydXN0LmNvbS9yb290cy9k\r\n"
  21. "c3Ryb290Y2F4My5wN2MwHwYDVR0jBBgwFoAUxKexpHsscfrb4UuQdf/EFWCFiRAw\r\n"
  22. "VAYDVR0gBE0wSzAIBgZngQwBAgEwPwYLKwYBBAGC3xMBAQEwMDAuBggrBgEFBQcC\r\n"
  23. "ARYiaHR0cDovL2Nwcy5yb290LXgxLmxldHNlbmNyeXB0Lm9yZzA8BgNVHR8ENTAz\r\n"
  24. "MDGgL6AthitodHRwOi8vY3JsLmlkZW50cnVzdC5jb20vRFNUUk9PVENBWDNDUkwu\r\n"
  25. "Y3JsMB0GA1UdDgQWBBSoSmpjBH3duubRObemRWXv86jsoTANBgkqhkiG9w0BAQsF\r\n"
  26. "AAOCAQEA3TPXEfNjWDjdGBX7CVW+dla5cEilaUcne8IkCJLxWh9KEik3JHRRHGJo\r\n"
  27. "uM2VcGfl96S8TihRzZvoroed6ti6WqEBmtzw3Wodatg+VyOeph4EYpr/1wXKtx8/\r\n"
  28. "wApIvJSwtmVi4MFU5aMqrSDE6ea73Mj2tcMyo5jMd6jmeWUHK8so/joWUoHOUgwu\r\n"
  29. "X4Po1QYz+3dszkDqMp4fklxBwXRsW10KXzPMTZ+sOPAveyxindmjkW8lGy+QsRlG\r\n"
  30. "PfZ+G6Z6h7mjem0Y+iWlkYcV4PIWL1iwBi8saCbGS5jN2p8M+X+Q7UNKEkROb3N6\r\n"
  31. "KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg==\r\n"
  32. "-----END CERTIFICATE-----\r\n"
  33. " "
  34. };
  35. #define MAX_HTTP_RECV_BUFFER 512
  36. static int e_count = 0;
  37. int _http_event_handler(http_client_event_t *evt)
  38. {
  39. switch(evt->event_id) {
  40. case HTTP_EVENT_ERROR:
  41. LOGD(TAG, "HTTP_EVENT_ERROR");
  42. break;
  43. case HTTP_EVENT_ON_CONNECTED:
  44. LOGD(TAG, "HTTP_EVENT_ON_CONNECTED");
  45. break;
  46. case HTTP_EVENT_HEADER_SENT:
  47. LOGD(TAG, "HTTP_EVENT_HEADER_SENT");
  48. break;
  49. case HTTP_EVENT_ON_HEADER:
  50. LOGD(TAG, "HTTP_EVENT_ON_HEADER, key=%s, value=%s", evt->header_key, evt->header_value);
  51. break;
  52. case HTTP_EVENT_ON_DATA:
  53. LOGD(TAG, "HTTP_EVENT_ON_DATA, len=%d", evt->data_len);
  54. if (!http_client_is_chunked_response(evt->client)) {
  55. // Write out data
  56. // printf("%.*s", evt->data_len, (char*)evt->data);
  57. }
  58. break;
  59. case HTTP_EVENT_ON_FINISH:
  60. LOGD(TAG, "HTTP_EVENT_ON_FINISH");
  61. break;
  62. case HTTP_EVENT_DISCONNECTED:
  63. LOGD(TAG, "HTTP_EVENT_DISCONNECTED");
  64. break;
  65. }
  66. return 0;
  67. }
  68. static void http_rest_with_url()
  69. {
  70. http_client_config_t config = {
  71. .url = "http://httpbin.org/get",
  72. .event_handler = _http_event_handler,
  73. };
  74. http_client_handle_t client = http_client_init(&config);
  75. // GET
  76. http_errors_t err = http_client_perform(client);
  77. if (err == HTTP_CLI_OK) {
  78. LOGI(TAG, "HTTP GET Status = %d, content_length = %d \r\n",
  79. http_client_get_status_code(client),
  80. http_client_get_content_length(client));
  81. } else {
  82. LOGE(TAG, "HTTP GET request failed: 0x%x @#@@@@@@", (err));
  83. e_count ++;
  84. }
  85. // POST
  86. const char *post_data = "field1=value1&field2=value2";
  87. http_client_set_url(client, "http://httpbin.org/post");
  88. http_client_set_method(client, HTTP_METHOD_POST);
  89. http_client_set_post_field(client, post_data, strlen(post_data));
  90. err = http_client_perform(client);
  91. if (err == HTTP_CLI_OK) {
  92. LOGI(TAG, "HTTP POST Status = %d, content_length = %d \r\n",
  93. http_client_get_status_code(client),
  94. http_client_get_content_length(client));
  95. } else {
  96. LOGE(TAG, "HTTP POST request failed: 0x%x @#@@@@@@", (err));
  97. e_count ++;
  98. }
  99. //PUT
  100. http_client_set_url(client, "http://httpbin.org/put");
  101. http_client_set_method(client, HTTP_METHOD_PUT);
  102. err = http_client_perform(client);
  103. if (err == HTTP_CLI_OK) {
  104. LOGI(TAG, "HTTP PUT Status = %d, content_length = %d \r\n",
  105. http_client_get_status_code(client),
  106. http_client_get_content_length(client));
  107. } else {
  108. LOGE(TAG, "HTTP PUT request failed: 0x%x @#@@@@@@", (err));
  109. e_count ++;
  110. }
  111. //PATCH
  112. http_client_set_url(client, "http://httpbin.org/patch");
  113. http_client_set_method(client, HTTP_METHOD_PATCH);
  114. http_client_set_post_field(client, NULL, 0);
  115. err = http_client_perform(client);
  116. if (err == HTTP_CLI_OK) {
  117. LOGI(TAG, "HTTP PATCH Status = %d, content_length = %d \r\n",
  118. http_client_get_status_code(client),
  119. http_client_get_content_length(client));
  120. } else {
  121. LOGE(TAG, "HTTP PATCH request failed: 0x%x @#@@@@@@", (err));
  122. e_count ++;
  123. }
  124. //DELETE
  125. http_client_set_url(client, "http://httpbin.org/delete");
  126. http_client_set_method(client, HTTP_METHOD_DELETE);
  127. err = http_client_perform(client);
  128. if (err == HTTP_CLI_OK) {
  129. LOGI(TAG, "HTTP DELETE Status = %d, content_length = %d \r\n",
  130. http_client_get_status_code(client),
  131. http_client_get_content_length(client));
  132. } else {
  133. LOGE(TAG, "HTTP DELETE request failed: 0x%x @#@@@@@@", (err));
  134. e_count ++;
  135. }
  136. //HEAD
  137. http_client_set_url(client, "http://httpbin.org/head");
  138. http_client_set_method(client, HTTP_METHOD_HEAD);
  139. err = http_client_perform(client);
  140. if (err == HTTP_CLI_OK) {
  141. LOGI(TAG, "HTTP HEAD Status = %d, content_length = %d \r\n",
  142. http_client_get_status_code(client),
  143. http_client_get_content_length(client));
  144. } else {
  145. LOGE(TAG, "HTTP HEAD request failed: 0x%x @#@@@@@@", (err));
  146. e_count ++;
  147. }
  148. http_client_cleanup(client);
  149. }
  150. static void http_rest_with_hostname_path()
  151. {
  152. http_client_config_t config = {
  153. .host = "httpbin.org",
  154. .path = "/get",
  155. .transport_type = HTTP_TRANSPORT_OVER_TCP,
  156. .event_handler = _http_event_handler,
  157. };
  158. http_client_handle_t client = http_client_init(&config);
  159. // GET
  160. http_errors_t err = http_client_perform(client);
  161. if (err == HTTP_CLI_OK) {
  162. LOGI(TAG, "HTTP GET Status = %d, content_length = %d \r\n",
  163. http_client_get_status_code(client),
  164. http_client_get_content_length(client));
  165. } else {
  166. LOGE(TAG, "HTTP GET request failed: 0x%x @#@@@@@@", (err));
  167. e_count ++;
  168. }
  169. // POST
  170. const char *post_data = "field1=value1&field2=value2";
  171. http_client_set_url(client, "/post");
  172. http_client_set_method(client, HTTP_METHOD_POST);
  173. http_client_set_post_field(client, post_data, strlen(post_data));
  174. err = http_client_perform(client);
  175. if (err == HTTP_CLI_OK) {
  176. LOGI(TAG, "HTTP POST Status = %d, content_length = %d \r\n",
  177. http_client_get_status_code(client),
  178. http_client_get_content_length(client));
  179. } else {
  180. LOGE(TAG, "HTTP POST request failed: 0x%x @#@@@@@@", (err));
  181. e_count ++;
  182. }
  183. //PUT
  184. http_client_set_url(client, "/put");
  185. http_client_set_method(client, HTTP_METHOD_PUT);
  186. err = http_client_perform(client);
  187. if (err == HTTP_CLI_OK) {
  188. LOGI(TAG, "HTTP PUT Status = %d, content_length = %d \r\n",
  189. http_client_get_status_code(client),
  190. http_client_get_content_length(client));
  191. } else {
  192. LOGE(TAG, "HTTP PUT request failed: 0x%x @#@@@@@@", (err));
  193. e_count ++;
  194. }
  195. //PATCH
  196. http_client_set_url(client, "/patch");
  197. http_client_set_method(client, HTTP_METHOD_PATCH);
  198. http_client_set_post_field(client, NULL, 0);
  199. err = http_client_perform(client);
  200. if (err == HTTP_CLI_OK) {
  201. LOGI(TAG, "HTTP PATCH Status = %d, content_length = %d \r\n",
  202. http_client_get_status_code(client),
  203. http_client_get_content_length(client));
  204. } else {
  205. LOGE(TAG, "HTTP PATCH request failed: 0x%x @#@@@@@@", (err));
  206. e_count ++;
  207. }
  208. //DELETE
  209. http_client_set_url(client, "/delete");
  210. http_client_set_method(client, HTTP_METHOD_DELETE);
  211. err = http_client_perform(client);
  212. if (err == HTTP_CLI_OK) {
  213. LOGI(TAG, "HTTP DELETE Status = %d, content_length = %d \r\n",
  214. http_client_get_status_code(client),
  215. http_client_get_content_length(client));
  216. } else {
  217. LOGE(TAG, "HTTP DELETE request failed: 0x%x @#@@@@@@", (err));
  218. e_count ++;
  219. }
  220. //HEAD
  221. http_client_set_url(client, "/get");
  222. http_client_set_method(client, HTTP_METHOD_HEAD);
  223. err = http_client_perform(client);
  224. if (err == HTTP_CLI_OK) {
  225. LOGI(TAG, "HTTP HEAD Status = %d, content_length = %d \r\n",
  226. http_client_get_status_code(client),
  227. http_client_get_content_length(client));
  228. } else {
  229. LOGE(TAG, "HTTP HEAD request failed: 0x%x @#@@@@@@", (err));
  230. e_count ++;
  231. }
  232. http_client_cleanup(client);
  233. }
  234. static void http_auth_basic()
  235. {
  236. http_client_config_t config = {
  237. .url = "http://user:passwd@httpbin.org/basic-auth/user/passwd",
  238. .event_handler = _http_event_handler,
  239. .auth_type = HTTP_AUTH_TYPE_BASIC,
  240. };
  241. http_client_handle_t client = http_client_init(&config);
  242. http_errors_t err = http_client_perform(client);
  243. if (err == HTTP_CLI_OK) {
  244. LOGI(TAG, "HTTP Basic Auth Status = %d, content_length = %d \r\n",
  245. http_client_get_status_code(client),
  246. http_client_get_content_length(client));
  247. } else {
  248. LOGE(TAG, "Error perform http request 0x%x @#@@@@@@", (err));
  249. e_count ++;
  250. }
  251. http_client_cleanup(client);
  252. }
  253. static void http_auth_basic_redirect()
  254. {
  255. http_client_config_t config = {
  256. .url = "http://user:passwd@httpbin.org/basic-auth/user/passwd",
  257. .event_handler = _http_event_handler,
  258. };
  259. http_client_handle_t client = http_client_init(&config);
  260. http_errors_t err = http_client_perform(client);
  261. if (err == HTTP_CLI_OK) {
  262. LOGI(TAG, "HTTP Basic Auth redirect Status = %d, content_length = %d \r\n",
  263. http_client_get_status_code(client),
  264. http_client_get_content_length(client));
  265. } else {
  266. LOGE(TAG, "Error perform http request 0x%x @#@@@@@@", (err));
  267. e_count ++;
  268. }
  269. http_client_cleanup(client);
  270. }
  271. static void http_auth_digest()
  272. {
  273. http_client_config_t config = {
  274. .url = "http://user:passwd@httpbin.org/digest-auth/auth/user/passwd/MD5/never",
  275. .event_handler = _http_event_handler,
  276. };
  277. http_client_handle_t client = http_client_init(&config);
  278. http_errors_t err = http_client_perform(client);
  279. if (err == HTTP_CLI_OK) {
  280. LOGI(TAG, "HTTP Digest Auth Status = %d, content_length = %d \r\n",
  281. http_client_get_status_code(client),
  282. http_client_get_content_length(client));
  283. } else {
  284. LOGE(TAG, "Error perform http request 0x%x @#@@@@@@", (err));
  285. e_count ++;
  286. }
  287. http_client_cleanup(client);
  288. }
  289. static void https_with_url()
  290. {
  291. http_client_config_t config = {
  292. .url = "https://www.howsmyssl.com",
  293. .event_handler = _http_event_handler,
  294. .cert_pem = ca_crt_rsa,
  295. };
  296. http_client_handle_t client = http_client_init(&config);
  297. http_errors_t err = http_client_perform(client);
  298. if (err == HTTP_CLI_OK) {
  299. LOGI(TAG, "HTTPS Status = %d, content_length = %d \r\n",
  300. http_client_get_status_code(client),
  301. http_client_get_content_length(client));
  302. } else {
  303. LOGE(TAG, "Error perform http request 0x%x @#@@@@@@", (err));
  304. e_count ++;
  305. }
  306. http_client_cleanup(client);
  307. }
  308. static void https_with_hostname_path()
  309. {
  310. http_client_config_t config = {
  311. .host = "www.howsmyssl.com",
  312. .path = "/",
  313. .transport_type = HTTP_TRANSPORT_OVER_SSL,
  314. .event_handler = _http_event_handler,
  315. .cert_pem = ca_crt_rsa,
  316. };
  317. http_client_handle_t client = http_client_init(&config);
  318. http_errors_t err = http_client_perform(client);
  319. if (err == HTTP_CLI_OK) {
  320. LOGI(TAG, "HTTPS Status = %d, content_length = %d \r\n",
  321. http_client_get_status_code(client),
  322. http_client_get_content_length(client));
  323. } else {
  324. LOGE(TAG, "Error perform http request 0x%x @#@@@@@@", (err));
  325. e_count ++;
  326. }
  327. http_client_cleanup(client);
  328. }
  329. static void http_relative_redirect()
  330. {
  331. http_client_config_t config = {
  332. .url = "http://httpbin.org/relative-redirect/3",
  333. .event_handler = _http_event_handler,
  334. };
  335. http_client_handle_t client = http_client_init(&config);
  336. http_errors_t err = http_client_perform(client);
  337. if (err == HTTP_CLI_OK) {
  338. LOGI(TAG, "HTTP Relative path redirect Status = %d, content_length = %d \r\n",
  339. http_client_get_status_code(client),
  340. http_client_get_content_length(client));
  341. } else {
  342. LOGE(TAG, "Error perform http request 0x%x @#@@@@@@", (err));
  343. e_count ++;
  344. }
  345. http_client_cleanup(client);
  346. }
  347. static void http_absolute_redirect()
  348. {
  349. http_client_config_t config = {
  350. .url = "http://httpbin.org/absolute-redirect/3",
  351. .event_handler = _http_event_handler,
  352. };
  353. http_client_handle_t client = http_client_init(&config);
  354. http_errors_t err = http_client_perform(client);
  355. if (err == HTTP_CLI_OK) {
  356. LOGI(TAG, "HTTP Absolute path redirect Status = %d, content_length = %d \r\n",
  357. http_client_get_status_code(client),
  358. http_client_get_content_length(client));
  359. } else {
  360. LOGE(TAG, "Error perform http request 0x%x @#@@@@@@", (err));
  361. e_count ++;
  362. }
  363. http_client_cleanup(client);
  364. }
  365. static void http_redirect_to_https()
  366. {
  367. http_client_config_t config = {
  368. .url = "http://httpbin.org/redirect-to?url=https%3A%2F%2Fwww.howsmyssl.com",
  369. .event_handler = _http_event_handler,
  370. };
  371. http_client_handle_t client = http_client_init(&config);
  372. http_errors_t err = http_client_perform(client);
  373. if (err == HTTP_CLI_OK) {
  374. LOGI(TAG, "HTTP redirect to HTTPS Status = %d, content_length = %d \r\n",
  375. http_client_get_status_code(client),
  376. http_client_get_content_length(client));
  377. } else {
  378. LOGE(TAG, "Error perform http request 0x%x @#@@@@@@", (err));
  379. e_count ++;
  380. }
  381. http_client_cleanup(client);
  382. }
  383. static void http_download_chunk()
  384. {
  385. http_client_config_t config = {
  386. .url = "http://httpbin.org/stream-bytes/8912",
  387. .event_handler = _http_event_handler,
  388. };
  389. http_client_handle_t client = http_client_init(&config);
  390. http_errors_t err = http_client_perform(client);
  391. if (err == HTTP_CLI_OK) {
  392. LOGI(TAG, "HTTP chunk encoding Status = %d, content_length = %d \r\n",
  393. http_client_get_status_code(client),
  394. http_client_get_content_length(client));
  395. } else {
  396. LOGE(TAG, "Error perform http request 0x%x @#@@@@@@", (err));
  397. e_count ++;
  398. }
  399. http_client_cleanup(client);
  400. }
  401. static void http_perform_as_stream_reader()
  402. {
  403. char *buffer = aos_malloc(MAX_HTTP_RECV_BUFFER + 1);
  404. if (buffer == NULL) {
  405. LOGE(TAG, "Cannot aos_malloc http receive buffer");
  406. return;
  407. }
  408. http_client_config_t config = {
  409. .url = "http://httpbin.org/get",
  410. .event_handler = _http_event_handler,
  411. };
  412. http_client_handle_t client = http_client_init(&config);
  413. http_errors_t err;
  414. if ((err = http_client_open(client, 0)) != HTTP_CLI_OK) {
  415. LOGE(TAG, "Failed to open HTTP connection: 0x%x @#@@@@@@", (err));
  416. aos_free(buffer);
  417. return;
  418. }
  419. int content_length = http_client_fetch_headers(client);
  420. int total_read_len = 0, read_len;
  421. if (total_read_len < content_length && content_length <= MAX_HTTP_RECV_BUFFER) {
  422. read_len = http_client_read(client, buffer, content_length);
  423. if (read_len <= 0) {
  424. LOGE(TAG, "Error read data");
  425. }
  426. buffer[read_len] = 0;
  427. LOGD(TAG, "read_len = %d", read_len);
  428. }
  429. LOGI(TAG, "HTTP Stream reader Status = %d, content_length = %d \r\n",
  430. http_client_get_status_code(client),
  431. http_client_get_content_length(client));
  432. http_client_close(client);
  433. http_client_cleanup(client);
  434. aos_free(buffer);
  435. }
  436. static void https_async()
  437. {
  438. http_client_config_t config = {
  439. .url = "https://postman-echo.com/post",
  440. .event_handler = _http_event_handler,
  441. .is_async = true,
  442. .timeout_ms = 5000,
  443. };
  444. http_client_handle_t client = http_client_init(&config);
  445. http_errors_t err;
  446. const char *post_data = "Using a Palantír requires a person with great strength of will and wisdom. The Palantíri were meant to "
  447. "be used by the Dúnedain to communicate throughout the Realms in Exile. During the War of the Ring, "
  448. "the Palantíri were used by many individuals. Sauron used the Ithil-stone to take advantage of the users "
  449. "of the other two stones, the Orthanc-stone and Anor-stone, but was also susceptible to deception himself.";
  450. http_client_set_method(client, HTTP_METHOD_POST);
  451. http_client_set_post_field(client, post_data, strlen(post_data));
  452. while (1) {
  453. err = http_client_perform(client);
  454. if (err != EAGAIN) {
  455. break;
  456. }
  457. }
  458. if (err == HTTP_CLI_OK) {
  459. LOGI(TAG, "HTTPS Status = %d, content_length = %d \r\n",
  460. http_client_get_status_code(client),
  461. http_client_get_content_length(client));
  462. } else {
  463. LOGE(TAG, "Error perform http request 0x%x @#@@@@@@", (err));
  464. e_count ++;
  465. }
  466. http_client_cleanup(client);
  467. }
  468. void test_https(void)
  469. {
  470. ca_crt_rsa[sizeof(ca_crt_rsa) - 1] = 0;
  471. http_rest_with_url();
  472. http_rest_with_hostname_path();
  473. http_auth_basic();
  474. http_auth_basic_redirect();
  475. http_auth_digest();
  476. http_relative_redirect();
  477. http_absolute_redirect();
  478. https_with_url();
  479. https_with_hostname_path();
  480. http_redirect_to_https();
  481. http_download_chunk();
  482. http_perform_as_stream_reader();
  483. https_async();
  484. LOGI(TAG, "Finish http example [%d]", e_count);
  485. }