barbieri pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a4931f4fb0ce1f992493e9d4b8963b11b6d524a6

commit a4931f4fb0ce1f992493e9d4b8963b11b6d524a6
Author: Gustavo Sverzut Barbieri <[email protected]>
Date:   Tue Nov 29 02:55:37 2016 -0200

    ecore_con_url_headers_example: allow POST data.
---
 src/examples/ecore/ecore_con_url_headers_example.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/examples/ecore/ecore_con_url_headers_example.c 
b/src/examples/ecore/ecore_con_url_headers_example.c
index 656743f..6c9e162 100644
--- a/src/examples/ecore/ecore_con_url_headers_example.c
+++ b/src/examples/ecore/ecore_con_url_headers_example.c
@@ -42,12 +42,12 @@ int
 main(int argc, const char *argv[])
 {
    Ecore_Con_Url *ec_url = NULL;
-   const char *type;
+   const char *type, *post_data = "";
    Eina_Bool r;
 
    if (argc < 3)
      {
-        printf("need at least two parameters: < POST|GET >  <url1>\n");
+        printf("need at least two parameters: < POST|GET >  <url1> 
[post-data]\n");
         return -1;
      }
 
@@ -59,6 +59,8 @@ main(int argc, const char *argv[])
         return -1;
      }
 
+   if (argc > 3) post_data = argv[3];
+
    ecore_init();
    ecore_con_init();
    ecore_con_url_init();
@@ -87,7 +89,7 @@ main(int argc, const char *argv[])
    if (!strcmp(type, "GET"))
      r = ecore_con_url_get(ec_url);
    else
-     r = ecore_con_url_post(ec_url, NULL, 0, NULL);
+     r = ecore_con_url_post(ec_url, post_data, strlen(post_data), NULL);
 
    if (!r)
      {

-- 


Reply via email to