httpclient源码介绍
前面介绍了hfs server的使用,本文使用设备系统为freertos,支持lwip协议,移植httpclient 后,从hfs server(这里本机电脑)获取文件。
httpclient主要存在两个结构体
//与建立网络连接相关,本文只看http,https省略(中间加层tls)
typedef struct {
int socket; /**< Socket ID. */
int remote_port; /**< HTTP or HTTPS port. */
int response_code; /**< Response code. */
char *header; /**< Request custom header. */
char *auth_user; /**< Username for basic authentication. */
char *auth_password; /**< Password for basic authentication. */
bool is_http; /**< Http connection? if 1, http; if 0, https. */
} httpclient_t;
//http通信数据有关
typedef struct {
bool is_more; /**< Indicates if more data needs to be retrieved. */
bool is_chunked;