|
luat_http_ctrl_t * | luat_http_client_create (luat_http_cb cb, void *user_param, int adapter_index) |
| 创建一个http客户端
|
|
int | luat_http_client_base_config (luat_http_ctrl_t *http_ctrl, uint32_t timeout, uint8_t debug_onoff, uint8_t retry_cnt) |
| http客户端的通用配置,创建客户端时已经有默认配置,可以不配置
|
|
int | luat_http_client_ssl_config (luat_http_ctrl_t *http_ctrl, int mode, const char *server_cert, uint32_t server_cert_len, const char *client_cert, uint32_t client_cert_len, const char *client_cert_key, uint32_t client_cert_key_len, const char *client_cert_key_password, uint32_t client_cert_key_password_len) |
| 客户端SSL配置,只有访问https才需要配置
|
|
int | luat_http_client_clear (luat_http_ctrl_t *http_ctrl) |
| 清空用户设置的POST数据和request head参数
|
|
int | luat_http_client_set_user_head (luat_http_ctrl_t *http_ctrl, const char *name, const char *value) |
| 设置一条用户的request head参数,Content-Length一般不需要,在设置POST的body时自动生成
|
|
int | luat_http_client_start (luat_http_ctrl_t *http_ctrl, const char *url, uint8_t type, uint8_t ipv6, uint8_t continue_mode) |
| 启动一个http请求
|
|
int | luat_http_client_close (luat_http_ctrl_t *http_ctrl) |
| 停止当前的http请求,调用后不再有http回调了
|
|
int | luat_http_client_destroy (luat_http_ctrl_t **p_http_ctrl) |
| 完全释放掉当前的http客户端
|
|
int | luat_http_client_post_body (luat_http_ctrl_t *http_ctrl, void *data, uint32_t len) |
| POST请求时发送body数据,如果数据量比较大,可以在HTTP_STATE_SEND_BODY回调里分次发送
|
|
int | luat_http_client_get_status_code (luat_http_ctrl_t *http_ctrl) |
| http获取状态码
|
|
int | luat_http_client_pause (luat_http_ctrl_t *http_ctrl, uint8_t is_pause) |
| http客户端设置暂停
|
|
int | luat_http_client_set_get_offset (luat_http_ctrl_t *http_ctrl, uint32_t offset) |
| GET请求时要求服务器从offset位置开始传输数据,谨慎使用
|
|