BugID:23266661: Remove redundant http api
@@ -72,6 +72,12 @@ typedef struct httpc_s {
#endif
} httpc_t;
+/** @brief This structure defines the httpclient and HTTP data structure. */
+typedef struct {
+ httpclient_t client;
+ httpclient_data_t client_data;
+} httpclient_source_t;
+
#define HTTPC_VERSION "HTTP/1.1"
#define HTTPC_CRLF "\r\n"
@@ -81,6 +87,28 @@ typedef struct httpc_param_s {
uint16_t len;
} httpc_param_t;
+/**
+ * This function initialize httpclient params.
+ * @param[in, out] source source is a pointer to the #httpclient_source_t.
+ * @param[in] header_size header_size is the max sending header length.
+ * @param[in] body_size body_size is the max response buf length.
+ * @return The HTTP response code of the last request.
+ */
+HTTPC_RESULT httpc_prepare(httpclient_source_t *source, int header_size, int body_size);
+/**
+ * This function deinitialize httpclient params.
+ * @param[in] source source is a pointer to the #httpclient_t.
+ * @return The HTTP response code of the last request.
+ */
+HTTPC_RESULT httpc_unprepare(httpclient_source_t* source);
+
+/**
+ * This function reset httpclient params.
+ * @param[in] source source is a pointer to the #httpclient_t.
+ * @return None
+ */
+void httpc_reset(httpclient_source_t *source);
+
void http_log(const char *fmt, ...);
#endif
