diff --git a/mbtk/test/mbtk_http_test.c b/mbtk/test/mbtk_http_test.c
new file mode 100755
index 0000000..edfd81d
--- /dev/null
+++ b/mbtk/test/mbtk_http_test.c
@@ -0,0 +1,74 @@
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#define LOG_TAG "mbtk_http"
+#include "mbtk_type.h"
+#include "mbtk_http.h"
+#include "mbtk_log.h"
+
+
+static void http_data_cb_func(
+    int session_id, mbtk_http_data_type_enum type,
+    void *data,int data_len)
+{
+    if(type == MBTK_HTTP_DATA_HEADER) {
+        printf("Header(%d):%s\n",data_len,(char*)data);
+    } else if(type == MBTK_HTTP_DATA_CONTENT) {
+        printf("Data(%d):%s\n",data_len,(char*)data);
+    } else {
+        LOGI(">>>>>Complete<<<<<\n");
+    }
+}
+
+int main(int argc, char *argv[])
+{
+    if(argc != 2) {
+        LOGE("ARG error.");
+        return -1;
+    }
+
+    LOGI("MBTK HTTP Version 1.1");
+
+    int http_handle = mbtk_http_handle_get(TRUE, http_data_cb_func);
+    if(http_handle < 0)
+    {
+        LOGE("mbtk_http_handle_get() fail.");
+        return -1;
+    }
+
+    int http_session = mbtk_http_session_create(http_handle,HTTP_OPTION_GET,HTTP_VERSION_1_1);
+    if(http_handle < 0)
+    {
+        LOGE("mbtk_http_session_create() fail.");
+        return -1;
+    }
+
+    if(mbtk_http_session_url_set(http_handle, http_session, argv[1])) {
+        LOGE("mbtk_http_session_url_set() fail.\n");
+        return -1;
+    }
+
+    const mbtk_http_session_t* session = mbtk_http_session_get(http_handle, http_session);
+    LOGI("HTTP:%d,%s,%d,%s\n",session->option,session->host,session->port,session->uri);
+
+
+    if(mbtk_http_session_start(http_handle, http_session)) {
+        LOGE("mbtk_http_session_start() fail.\n");
+        return -1;
+    }
+
+
+    if(mbtk_http_handle_free(http_handle))
+    {
+        LOGE("mbtk_http_handle_free() fail.");
+        return -1;
+    }
+
+    LOGI("MBTK_HTTP exit.");
+    return 0;
+
+}
