]> gitweb.ps.run Git - matrix_esp_thesis/blobdiff - src/matrix_http_mongoose.c
fix examples
[matrix_esp_thesis] / src / matrix_http_mongoose.c
index a514f72b301eccef9009d466fee310228d82d024..452e26c59fb0b26de08671e449e16caaa029feec 100644 (file)
@@ -43,6 +43,10 @@ MatrixHttpCallback(
 \r
         conn->connection = c;\r
         conn->connected = true;\r
+    }\r
+    if (ev == MG_EV_HTTP_CHUNK)\r
+    {\r
+        \r
     }\r
     if (ev == MG_EV_HTTP_MSG)\r
     {\r
@@ -132,6 +136,15 @@ MatrixHttpGet(
     else\r
         authorizationHeader[0] = '\0';\r
 \r
+    printf(\r
+        "GET %s HTTP/1.1\r\n"\r
+        "Host: %.*s\r\n"\r
+        "%s"\r
+        "\r\n",\r
+        url,\r
+        host.len, host.ptr,\r
+        authorizationHeader);\r
+\r
     mg_printf(conn->connection,\r
         "GET %s HTTP/1.1\r\n"\r
         "Host: %.*s\r\n"\r
@@ -173,6 +186,21 @@ MatrixHttpPost(
     else\r
         authorizationHeader[0] = '\0';\r
 \r
+    printf(\r
+            "POST %s HTTP/1.0\r\n"\r
+            "Host: %.*s\r\n"\r
+            "%s"\r
+            "Content-Type: application/json\r\n"\r
+            "Content-Length: %d\r\n"\r
+            "\r\n"\r
+            "%s"\r
+            "\r\n",\r
+            url,\r
+            host.len, host.ptr,\r
+            authorizationHeader,\r
+            strlen(requestBuffer),\r
+            requestBuffer);\r
+\r
     mg_printf(conn->connection,\r
             "POST %s HTTP/1.0\r\n"\r
             "Host: %.*s\r\n"\r
@@ -220,6 +248,22 @@ MatrixHttpPut(
     else\r
         authorizationHeader[0] = '\0';\r
 \r
+    \r
+    printf(\r
+            "PUT %s HTTP/1.0\r\n"\r
+            "Host: %.*s\r\n"\r
+            "%s"\r
+            "Content-Type: application/json\r\n"\r
+            "Content-Length: %d\r\n"\r
+            "\r\n"\r
+            "%s"\r
+            "\r\n",\r
+            url,\r
+            host.len, host.ptr,\r
+            authorizationHeader,\r
+            strlen(requestBuffer),\r
+            requestBuffer);\r
+\r
     mg_printf(conn->connection,\r
             "PUT %s HTTP/1.0\r\n"\r
             "Host: %.*s\r\n"\r