http_client.h
来自「AMLOGIC DPF source code」· C头文件 代码 · 共 104 行
H
104 行
/*******************************************************************
*
* Copyright C 2005 by Amlogic, Inc. All Rights Reserved.
*
* Description:
*
* Author: Eric Knudstrup
* Created: Thu Mar 31 17:43:49 2005
*
*******************************************************************/
#ifndef HTTP_CLIENT_H
#define HTTP_CLIENT_H
/**
* @file http_client.h
* Top level HTTP client routines. Provided by http_client.lib.
*/
/** @defgroup http_client HTTP Client functions for application use.
* @ingroup Network
*/
/*@{*/
/*;emacs generated header for file http_client.c. Global function declarations only. */
/**
* Initiate an HTTP GET transaction. Connects to the server and retrieves the
* document from \a uri_string. Only one request per HTTPTcpConnection_t may be
* outstanding at a time.
* @param [in] client HTTPTcpConnection_t to connect through.
* @param [in] uri_path URI path to retrieve.
* @param [in] start Offset into file to start retrieving.
* @param [in] length Number of bytes to ask for.
*/
extern int
httpGETRange(HTTPTcpConnection_t *client, char *uri_path, int start, int length);
/**
* Initiate an HTTP GET transaction. Connects to the server and retrieves the
* document from \a uri_string. Only one request per HTTPTcpConnection_t may be
* outstanding at a time.
* @param [in] client HTTPTcpConnection_t to connect through.
* @param [in] uri_path URI path to retrieve.
*/
extern int
httpGET(HTTPTcpConnection_t *client, char *uri_path);
/**
* Clear all state for this client to prepare for a new request.
* Static headers remain.
*/
extern void
http_client_reset(HTTPTcpConnection_t *client);
/**
* Create an HTTP 1.1 client connection.
*
* @param [in] complete_cb Function called to notify that a
* transaction has completed.
* @param [in] content_init_cb Function called to set up
* content reception.
* @param [in] user_context User context used in callbacks.
* @param [in] ipaddr IP Address to connect to.
* @param [in] port TCP port to connect to.
*
* @returns A pointer to an HTTPTcpConnection_t if successfully allocated.
*/
extern HTTPTcpConnection_t *
http_client_create(HTTPCompleteCb complete_cb,
HTTPContentInitCb content_init_cb,
void *user_context,
struct ip_addr *ipaddr,
uint16_t port);
/**
* Create an HTTP client connection specifying protocol
* dialect and major/minor versions.
*
* @param [in] complete_cb Function called to notify that a
* transaction has completed.
* @param [in] content_init_cb Function called to set up
* content reception.
* @param [in] user_context User context used in callbacks.
* @param [in] ipaddr IP Address to connect to.
* @param [in] port TCP port to connect to.
* @param [in] proto Protocol to use ("HTTP")
* @param [in] major Protocol major version number
* @param [in] minor Protocol minor version number
*
* @returns A pointer to an HTTPTcpConnection_t if successfully allocated.
*/
extern HTTPTcpConnection_t *
http_client_create_proto(HTTPCompleteCb complete_cb,
HTTPContentInitCb content_init_cb,
void *user_context,
struct ip_addr *ipaddr,
uint16_t port,
char *proto, int major, int minor);
/*;end emacs generated header for file http_client.c. Global function declarations only. */
#endif
/*@}*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?