TI-RTOS Network Services  2.14.04.31
httpcli.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 #ifndef ti_net_http_HTTPCli__include
33 #define ti_net_http_HTTPCli__include
34 
275 #ifdef __cplusplus
276 extern "C" {
277 #endif
278 
279 #include <stdbool.h>
280 #include <ti/net/network.h>
281 #include <ti/net/http/httpstd.h>
282 #include <ti/net/http/ssock.h>
283 
288 #ifndef HTTPCli_BUF_LEN
289 #define HTTPCli_BUF_LEN 128
290 #endif
291 
301 #define HTTPCli_ESOCKETFAIL (-101)
302 
308 #define HTTPCli_ECONNECTFAIL (-102)
309 
315 #define HTTPCli_ESENDFAIL (-103)
316 
322 #define HTTPCli_ERECVFAIL (-104)
323 
329 #define HTTPCli_ETLSFAIL (-105)
330 
334 #define HTTPCli_EHOSTNAME (-106)
335 
342 #define HTTPCli_ESENDBUFSMALL (-107)
343 
350 #define HTTPCli_ERECVBUFSMALL (-108)
351 
355 #define HTTPCli_EASYNCMODE (-109)
356 
360 #define HTTPCli_ETHREADFAIL (-110)
361 
365 #define HTTPCli_EPROXYTUNNELFAIL (-111)
366 
370 #define HTTPCli_ERESPONSEINVALID (-112)
371 
378 #define HTTPCli_ECONTENTLENLARGE (-114)
379 
386 #define HTTPCli_EREDIRECTURILONG (-115)
387 
391 #define HTTPCli_ECONTENTTYPELONG (-116)
392 
399 #define HTTPCli_ENOCONTENTCALLBACK (-117)
400 
404 #define HTTPCli_ENOTCHUNKDATA (-118)
405 
409 #define HTTPCli_EINPROGRESS (-119)
410 
414 #define HTTPCli_EINTERNALBUFSMALL (-120)
415 
419 #define HTTPCli_ESETNOTIFYFAIL (-121)
420 
427 #define HTTPCli_EURILENLONG (-122)
428 
436 #define HTTPCli_EHOSTFIELDNOTFOUND (-123)
437 
439 #ifdef ti_net_http_HTTPCli__deprecated
440 
443 /* Standard ports */
444 #define HTTP_PORT HTTPStd_PORT
445 #define HTTPS_PORT HTTPStd_SECURE_PORT
446 
447 /* HTTP Status Codes */
448 #define HTTP_CONTINUE HTTPStd_CONTINUE
449 #define HTTP_SWITCHING_PROTOCOLS HTTPStd_SWITCHING_PROTOCOLS
450 #define HTTP_OK HTTPStd_OK
451 #define HTTP_CREATED HTTPStd_CREATED
452 #define HTTP_ACCEPTED HTTPStd_ACCEPTED
453 #define HTTP_NON_AUTHORITATIVE_INFORMATION HTTPStd_NON_AUTHORITATIVE_INFORMATION
454 #define HTTP_NO_CONTENT HTTPStd_NO_CONTENT
455 #define HTTP_RESET_CONTENT HTTPStd_RESET_CONTENT
456 #define HTTP_PARTIAL_CONTENT HTTPStd_PARTIAL_CONTENT
457 #define HTTP_MULTIPLE_CHOICES HTTPStd_MULTIPLE_CHOICES
458 #define HTTP_MOVED_PERMANENTLY HTTPStd_MOVED_PERMANENTLY
459 #define HTTP_FOUND HTTPStd_FOUND
460 #define HTTP_SEE_OTHER HTTPStd_SEE_OTHER
461 #define HTTP_NOT_MODIFIED HTTPStd_NOT_MODIFIED
462 #define HTTP_USE_PROXY HTTPStd_USE_PROXY
463 #define HTTP_TEMPORARY_REDIRECT HTTPStd_TEMPORARY_REDIRECT
464 #define HTTP_BAD_REQUEST HTTPStd_BAD_REQUEST
465 #define HTTP_UNAUTHORIZED HTTPStd_UNAUTHORIZED
466 #define HTTP_PAYMENT_REQUIRED HTTPStd_PAYMENT_REQUIRED
467 #define HTTP_FORBIDDEN HTTPStd_FORBIDDEN
468 #define HTTP_NOT_FOUND HTTPStd_NOT_FOUND
469 #define HTTP_METHOD_NOT_ALLOWED HTTPStd_METHOD_NOT_ALLOWED
470 #define HTTP_NOT_ACCEPTABLE HTTPStd_NOT_ACCEPTABLE
471 #define HTTP_PROXY_AUTHENTICATION_REQUIRED HTTPStd_PROXY_AUTHENTICATION_REQUIRED
472 #define HTTP_REQUEST_TIMEOUT HTTPStd_REQUEST_TIMEOUT
473 #define HTTP_CONFLICT HTTPStd_CONFLICT
474 #define HTTP_GONE HTTPStd_GONE
475 #define HTTP_LENGTH_REQUIRED HTTPStd_LENGTH_REQUIRED
476 #define HTTP_PRECONDITION_FAILED HTTPStd_PRECONDITION_FAILED
477 #define HTTP_REQUEST_ENTITY_TOO_LARGE HTTPStd_REQUEST_ENTITY_TOO_LARGE
478 #define HTTP_REQUEST_URI_TOO_LONG HTTPStd_REQUEST_URI_TOO_LONG
479 #define HTTP_UNSUPPORTED_MEDIA_TYPE HTTPStd_UNSUPPORTED_MEDIA_TYPE
480 #define HTTP_REQUESTED_RANGE_NOT_SATISFAIABLE \
481  HTTPStd_REQUESTED_RANGE_NOT_SATISFAIABLE
482 #define HTTP_EXPECTATION_FAILED HTTPStd_EXPECTATION_FAILED
483 #define HTTP_INTERNAL_SERVER_ERROR HTTPStd_INTERNAL_SERVER_ERROR
484 #define HTTP_NOT_IMPLEMENTED HTTPStd_NOT_IMPLEMENTED
485 #define HTTP_BAD_GATEWAY HTTPStd_BAD_GATEWAY
486 #define HTTP_SERVICE_UNAVAILABLE HTTPStd_SERVICE_UNAVAILABLE
487 #define HTTP_GATEWAY_TIMEOUT HTTPStd_GATEWAY_TIMEOUT
488 #define HTTP_HTTP_VERSION_NOT_SUPPORTED HTTPStd_HTTP_VERSION_NOT_SUPPORTED
489 
490 /* HTTP methods */
491 #define HTTPCli_METHOD_GET HTTPStd_GET
492 #define HTTPCli_METHOD_POST HTTPStd_POST
493 #define HTTPCli_METHOD_HEAD HTTPStd_HEAD
494 #define HTTPCli_METHOD_OPTIONS HTTPStd_OPTIONS
495 #define HTTPCli_METHOD_PUT HTTPStd_PUT
496 #define HTTPCli_METHOD_DELETE HTTPStd_DELETE
497 #define HTTPCli_METHOD_CONNECT HTTPStd_CONNECT
498 
499 /* HTTP Request Field Name */
500 #define HTTPCli_FIELD_NAME_ACCEPT HTTPStd_FIELD_NAME_ACCEPT
501 #define HTTPCli_FIELD_NAME_ACCEPT_CHARSET HTTPStd_FIELD_NAME_ACCEPT_CHARSET
502 #define HTTPCli_FIELD_NAME_ACCEPT_ENCODING HTTPStd_FIELD_NAME_ACCEPT_ENCODING
503 #define HTTPCli_FIELD_NAME_ACCEPT_LANGUAGE HTTPStd_FIELD_NAME_ACCEPT_LANGUAGE
504 #define HTTPCli_FIELD_NAME_ACCEPT_RANGES HTTPStd_FIELD_NAME_ACCEPT_RANGES
505 #define HTTPCli_FIELD_NAME_AGE HTTPStd_FIELD_NAME_AGE
506 #define HTTPCli_FIELD_NAME_ALLOW HTTPStd_FIELD_NAME_ALLOW
507 #define HTTPCli_FIELD_NAME_AUTHORIZATION HTTPStd_FIELD_NAME_AUTHORIZATION
508 #define HTTPCli_FIELD_NAME_CACHE_CONTROL HTTPStd_FIELD_NAME_CACHE_CONTROL
509 #define HTTPCli_FIELD_NAME_CONNECTION HTTPStd_FIELD_NAME_CONNECTION
510 #define HTTPCli_FIELD_NAME_CONTENT_ENCODING HTTPStd_FIELD_NAME_CONTENT_ENCODING
511 #define HTTPCli_FIELD_NAME_CONTENT_LANGUAGE HTTPStd_FIELD_NAME_CONTENT_LANGUAGE
512 #define HTTPCli_FIELD_NAME_CONTENT_LENGTH HTTPStd_FIELD_NAME_CONTENT_LENGTH
513 #define HTTPCli_FIELD_NAME_CONTENT_LOCATION HTTPStd_FIELD_NAME_CONTENT_LOCATION
514 #define HTTPCli_FIELD_NAME_CONTENT_MD5 HTTPStd_FIELD_NAME_CONTENT_MD5
515 #define HTTPCli_FIELD_NAME_CONTENT_RANGE HTTPStd_FIELD_NAME_CONTENT_RANGE
516 #define HTTPCli_FIELD_NAME_CONTENT_TYPE HTTPStd_FIELD_NAME_CONTENT_TYPE
517 #define HTTPCli_FIELD_NAME_COOKIE HTTPStd_FIELD_NAME_COOKIE
518 #define HTTPCli_FIELD_NAME_DATE HTTPStd_FIELD_NAME_DATE
519 #define HTTPCli_FIELD_NAME_ETAG HTTPStd_FIELD_NAME_ETAG
520 #define HTTPCli_FIELD_NAME_EXPECT HTTPStd_FIELD_NAME_EXPECT
521 #define HTTPCli_FIELD_NAME_EXPIRES HTTPStd_FIELD_NAME_EXPIRES
522 #define HTTPCli_FIELD_NAME_FROM HTTPStd_FIELD_NAME_FROM
523 #define HTTPCli_FIELD_NAME_HOST HTTPStd_FIELD_NAME_HOST
524 #define HTTPCli_FIELD_NAME_IF_MATCH HTTPStd_FIELD_NAME_IF_MATCH
525 #define HTTPCli_FIELD_NAME_IF_MODIFIED_SINCE \
526  HTTPStd_FIELD_NAME_IF_MODIFIED_SINCE
527 #define HTTPCli_FIELD_NAME_IF_NONE_MATCH HTTPStd_FIELD_NAME_IF_NONE_MATCH
528 #define HTTPCli_FIELD_NAME_IF_RANGE HTTPStd_FIELD_NAME_IF_RANGE
529 #define HTTPCli_FIELD_NAME_IF_UNMODIFIED_SINCE \
530  HTTPStd_FIELD_NAME_IF_UNMODIFIED_SINCE
531 #define HTTPCli_FIELD_NAME_LAST_MODIFIED HTTPStd_FIELD_NAME_LAST_MODIFIED
532 #define HTTPCli_FIELD_NAME_LOCATION HTTPStd_FIELD_NAME_LOCATION
533 #define HTTPCli_FIELD_NAME_MAX_FORWARDS HTTPStd_FIELD_NAME_MAX_FORWARDS
534 #define HTTPCli_FIELD_NAME_ORIGIN HTTPStd_FIELD_NAME_ORIGIN
535 #define HTTPCli_FIELD_NAME_PRAGMA HTTPStd_FIELD_NAME_PRAGMA
536 #define HTTPCli_FIELD_NAME_PROXY_AUTHENTICATE \
537  HTTPStd_FIELD_NAME_PROXY_AUTHENTICATE
538 #define HTTPCli_FIELD_NAME_PROXY_AUTHORIZATION \
539  HTTPStd_FIELD_NAME_PROXY_AUTHORIZATION
540 #define HTTPCli_FIELD_NAME_RANGE HTTPStd_FIELD_NAME_RANGE
541 #define HTTPCli_FIELD_NAME_REFERER HTTPStd_FIELD_NAME_REFERER
542 #define HTTPCli_FIELD_NAME_RETRY_AFTER HTTPStd_FIELD_NAME_RETRY_AFTER
543 #define HTTPCli_FIELD_NAME_SERVER HTTPStd_FIELD_NAME_SERVER
544 #define HTTPCli_FIELD_NAME_TE HTTPStd_FIELD_NAME_TE
545 #define HTTPCli_FIELD_NAME_TRAILER HTTPStd_FIELD_NAME_TRAILER
546 #define HTTPCli_FIELD_NAME_TRANSFER_ENCODING \
547  HTTPStd_FIELD_NAME_TRANSFER_ENCODING
548 #define HTTPCli_FIELD_NAME_UPGRADE HTTPStd_FIELD_NAME_UPGRADE
549 #define HTTPCli_FIELD_NAME_USER_AGENT HTTPStd_FIELD_NAME_USER_AGENT
550 #define HTTPCli_FIELD_NAME_VARY HTTPStd_FIELD_NAME_VARY
551 #define HTTPCli_FIELD_NAME_VIA HTTPStd_FIELD_NAME_VIA
552 #define HTTPCli_FIELD_NAME_WWW_AUTHENTICATE HTTPStd_FIELD_NAME_WWW_AUTHENTICATE
553 #define HTTPCli_FIELD_NAME_WARNING HTTPStd_FIELD_NAME_WARNING
554 #define HTTPCli_FIELD_NAME_X_FORWARDED_FOR HTTPStd_FIELD_NAME_X_FORWARDED_FOR
555 
556 #endif
557 
562 #define HTTPCli_TYPE_TLS (0x02)
563 #define HTTPCli_TYPE_IPV6 (0x04)
564 
571 #define HTTPCli_FIELD_ID_DUMMY (-11)
572 #define HTTPCli_FIELD_ID_END (-12)
573 
578 typedef struct HTTPCli_Field {
579  const char *name;
580  const char *value;
581 } HTTPCli_Field;
582 
590 typedef void (*HTTPCli_StatusCallback)(void *cli, int status);
591 
595 typedef struct HTTPCli_StatusHandler {
600 
616 typedef int (*HTTPCli_ContentCallback)(void *cli, int status, char *body,
617  int len, bool moreFlag);
618 
622 typedef struct HTTPCli_ContentHandler {
623  char *contentType;
626 
636 typedef void (*HTTPCli_RedirectCallback)(void *cli, int status, char *uri);
637 
648 typedef void (*HTTPCli_Notify)(long skt, void *cli);
658 typedef struct HTTPCli_Struct {
659  char **respFields;
660  int sockerr;
661  unsigned int state;
662  unsigned long clen;
663  Ssock_Struct ssock;
665 
667  unsigned int buflen;
668  char *bufptr;
669 
670 #ifndef HTTPCli_LIBTYPE_MIN
674 #ifndef __linux__
675  unsigned int stackSize;
676  unsigned int priority;
677 #endif
678 #endif
679 
681 
689 typedef struct HTTPCli_Params {
690 
691 #ifndef HTTPCli_LIBTYPE_MIN
695 #ifndef __linux__
696  unsigned int stackSize;
697  unsigned int priority;
698 #endif
699 #endif
700 
701 #ifdef NET_SLP
702  HTTPCli_Notify rnotify;
703  HTTPCli_Notify wnotify;
704  HTTPCli_Notify enotify;
705 #endif
706 
707 #ifndef NET_SLP
708  int timeout;
710 #endif
711 
713 
715 
734 extern int HTTPCli_initSockAddr(struct sockaddr *addr, const char *uri,
735  int flags);
736 
742 extern void HTTPCli_construct(HTTPCli_Struct *cli);
743 
749 extern HTTPCli_Handle HTTPCli_create();
750 
766 extern int HTTPCli_connect(HTTPCli_Handle cli, const struct sockaddr *addr,
767  int flags, const HTTPCli_Params *params);
768 
775 extern void HTTPCli_delete(HTTPCli_Handle *cli);
776 
782 extern void HTTPCli_destruct(HTTPCli_Struct *cli);
783 
789 extern void HTTPCli_disconnect(HTTPCli_Handle cli);
790 
804 extern HTTPCli_Field *HTTPCli_setRequestFields(HTTPCli_Handle cli,
805  const HTTPCli_Field *fields);
806 
820 extern char **HTTPCli_setResponseFields(HTTPCli_Handle cli,
821  const char *fields[]);
822 
846 extern int HTTPCli_sendRequest(HTTPCli_Handle cli, const char *method,
847  const char *requestURI, bool moreFlag);
848 
866 extern int HTTPCli_sendField(HTTPCli_Handle cli, const char *name,
867  const char *value, bool lastFlag);
868 
883 extern int HTTPCli_sendRequestBody(HTTPCli_Handle cli, const char *body,
884  int len);
885 
897 extern int HTTPCli_getResponseStatus(HTTPCli_Handle cli);
898 
922 extern int HTTPCli_getResponseField(HTTPCli_Handle cli, char *value,
923  int len, bool *moreFlag);
924 
945 extern int HTTPCli_readResponseBody(HTTPCli_Handle cli, char *body,
946  int len, bool *moreFlag);
947 
964 extern int HTTPCli_readRawResponseBody(HTTPCli_Handle cli, char *body, int len);
965 
971 extern void HTTPCli_setProxy(const struct sockaddr *addr);
972 
989 extern int HTTPCli_getSocketError(HTTPCli_Handle cli);
990 
991 #ifdef __cplusplus
992 }
993 #endif
994 
996 #endif
HTTPCli_StatusHandler * shandle
Definition: httpcli.h:692
#define HTTPCli_BUF_LEN
Definition: httpcli.h:289
HTTPCli_ContentCallback handle
Definition: httpcli.h:624
HTTPCli_Field * HTTPCli_setRequestFields(HTTPCli_Handle cli, const HTTPCli_Field *fields)
Set an array of header fields to be sent for every HTTP request.
struct HTTPCli_Params HTTPCli_Params
HTTPCli instance paramaters.
HTTPCli_ContentHandler * chandle
Definition: httpcli.h:672
void HTTPCli_disconnect(HTTPCli_Handle cli)
Disconnect from the HTTP server and destroy the HTTP client instance.
HTTPCli_RedirectCallback rhandle
Definition: httpcli.h:673
struct HTTPCli_Struct HTTPCli_Struct
HTTPCli instance type.
struct HTTPCli_Field HTTPCli_Field
HTTPCli request header field.
Ssock_Struct ssock
Definition: httpcli.h:663
void HTTPCli_setProxy(const struct sockaddr *addr)
Set the proxy address.
unsigned long clen
Definition: httpcli.h:662
int HTTPCli_sendField(HTTPCli_Handle cli, const char *name, const char *value, bool lastFlag)
Send an header field to the HTTP server.
unsigned int state
Definition: httpcli.h:661
Standard Definitions for HTTP Status Codes, Content Type and Fields.
HTTPCli request header field.
Definition: httpcli.h:578
HTTPCli_StatusCallback handle1xx
Definition: httpcli.h:596
unsigned int priority
Definition: httpcli.h:697
int HTTPCli_sendRequestBody(HTTPCli_Handle cli, const char *body, int len)
Send the request message body to the HTTP server.
HTTPCli content handler type.
Definition: httpcli.h:622
HTTPCli_Struct * HTTPCli_Handle
Definition: httpcli.h:714
unsigned int stackSize
Definition: httpcli.h:696
int HTTPCli_getSocketError(HTTPCli_Handle cli)
Get the error code from the socket/TLS layer.
HTTPCli instance type.
Definition: httpcli.h:658
int(* HTTPCli_ContentCallback)(void *cli, int status, char *body, int len, bool moreFlag)
HTTPCli callback function for content handling.
Definition: httpcli.h:616
int timeout
Definition: httpcli.h:708
int HTTPCli_readRawResponseBody(HTTPCli_Handle cli, char *body, int len)
Read the raw response message body from the HTTP server.
int HTTPCli_initSockAddr(struct sockaddr *addr, const char *uri, int flags)
Initialize the socket address structure for the given URI.
int HTTPCli_connect(HTTPCli_Handle cli, const struct sockaddr *addr, int flags, const HTTPCli_Params *params)
Open a connection to an HTTP server.
void HTTPCli_destruct(HTTPCli_Struct *cli)
Destory the HTTP client instance.
HTTPCli_StatusCallback handle2xx
Definition: httpcli.h:597
char * bufptr
Definition: httpcli.h:668
HTTPCli_RedirectCallback rhandle
Definition: httpcli.h:694
char * contentType
Definition: httpcli.h:623
HTTPCli_StatusCallback handle4xx
Definition: httpcli.h:598
char ** respFields
Definition: httpcli.h:659
unsigned int stackSize
Definition: httpcli.h:675
const char * value
Definition: httpcli.h:580
unsigned int priority
Definition: httpcli.h:676
int sockerr
Definition: httpcli.h:660
int HTTPCli_sendRequest(HTTPCli_Handle cli, const char *method, const char *requestURI, bool moreFlag)
Make an HTTP 1.1 request to the HTTP server.
const char * name
Definition: httpcli.h:579
HTTPCli_ContentHandler * chandle
Definition: httpcli.h:693
int HTTPCli_getResponseStatus(HTTPCli_Handle cli)
Process the response header from the HTTP server and return status.
int HTTPCli_getResponseField(HTTPCli_Handle cli, char *value, int len, bool *moreFlag)
Process the response header from the HTTP server and return field.
HTTPCli instance paramaters.
Definition: httpcli.h:689
struct HTTPCli_StatusHandler HTTPCli_StatusHandler
HTTPCli response status code handler type.
char ** HTTPCli_setResponseFields(HTTPCli_Handle cli, const char *fields[])
Set the header fields to filter the response headers.
void(* HTTPCli_StatusCallback)(void *cli, int status)
HTTPCli callback function for status handling.
Definition: httpcli.h:590
HTTPCli response status code handler type.
Definition: httpcli.h:595
HTTPCli_Handle HTTPCli_create()
Allocate and initialize a new instance object and return its handle.
HTTPCli_Field * fields
Definition: httpcli.h:664
void HTTPCli_construct(HTTPCli_Struct *cli)
Create a new instance object in the provided structure.
HTTPCli_StatusHandler * shandle
Definition: httpcli.h:671
struct HTTPCli_ContentHandler HTTPCli_ContentHandler
HTTPCli content handler type.
void(* HTTPCli_RedirectCallback)(void *cli, int status, char *uri)
HTTPCli callback function prototype for redirection handling.
Definition: httpcli.h:636
char buf[HTTPCli_BUF_LEN]
Definition: httpcli.h:666
unsigned int buflen
Definition: httpcli.h:667
int HTTPCli_readResponseBody(HTTPCli_Handle cli, char *body, int len, bool *moreFlag)
Read the parsed response body data from the HTTP server.
void HTTPCli_delete(HTTPCli_Handle *cli)
Destory the HTTP client instance and free the previously allocated instance object.
Copyright 2015, Texas Instruments Incorporated