#include <stdio.h>
#include <Ecore.h>
#include <Ecore_Con.h>
 
{
   int i;
 
   for (i = 0; i < url_data->
size; i++)
 
     printf(
"%c", url_data->
data[i]);
 
}
 
{
   char *str;
 
   printf("\n");
   printf(
"download completed with status code: %d\n", url_complete->
status);
 
 
     printf("header: %s\n", str);
 
 
}
 
int
main(int argc, const char *argv[])
{
   const char *type, *post_data = "";
 
   if (argc < 3)
     {
        printf("need at least two parameters: < POST|GET >  <url1> [post-data]\n");
        return -1;
     }
 
   type = argv[1];
 
   if (strcmp(type, "POST") && (strcmp(type, "GET")))
     {
        printf("only POST or GET are supported by this example.\n");
        return -1;
     }
 
   if (argc > 3) post_data = argv[3];
 
 
   
 
   if (!ec_url)
     {
        printf("error when creating ecore con url object.\n");
        goto end;
     }
 
 
 
 
 
   if (!strcmp(type, "GET"))
   else
 
   if (!r)
     {
        printf("could not realize request.\n");
        goto free_ec_url;
     }
 
 
free_ec_url:
end:
 
   return 0;
}
 
EAPI int ECORE_CON_EVENT_URL_DATA
A URL object has data.
Definition: ecore_con_url.c:29
EAPI int ECORE_CON_EVENT_URL_COMPLETE
A URL object has completed its transfer to and from the server and can be reused.
Definition: ecore_con_url.c:30
EAPI int ecore_con_shutdown(void)
Shuts down the Ecore_Con library.
Definition: ecore_con.c:133
EAPI int ecore_con_init(void)
Initializes the Ecore_Con library.
Definition: ecore_con.c:68
EAPI Eina_Bool ecore_con_url_post(Ecore_Con_Url *url_con, const void *data, long length, const char *content_type)
Sends a post request.
Definition: ecore_con_url.c:904
EAPI Eina_Bool ecore_con_url_get(Ecore_Con_Url *url_con)
Sends a get request.
Definition: ecore_con_url.c:862
EAPI void ecore_con_url_free(Ecore_Con_Url *url_con)
Destroys an Ecore_Con_Url connection object.
Definition: ecore_con_url.c:819
EAPI void ecore_con_url_time(Ecore_Con_Url *url_con, Ecore_Con_Url_Time time_condition, double timestamp)
Sets whether HTTP requests should be conditional, dependent on modification time.
Definition: ecore_con_url.c:1001
EAPI const Eina_List * ecore_con_url_response_headers_get(Ecore_Con_Url *url_con)
Retrieves headers from last request sent.
Definition: ecore_con_url.c:1294
EAPI int ecore_con_url_init(void)
Initializes the Ecore_Con_Url library.
Definition: ecore_con_url.c:45
EAPI Eina_Bool ecore_con_url_httpauth_set(Ecore_Con_Url *url_con, const char *username, const char *password, Eina_Bool safe)
Sets url_con to use http auth, with given username and password, "safely" or not.
Definition: ecore_con_url.c:1321
EAPI Eina_Bool ecore_con_url_pipeline_get(void)
Is HTTP 1.1 pipelining enable ?
Definition: ecore_con_url.c:97
EAPI void ecore_con_url_pipeline_set(Eina_Bool enable)
Enables or disable HTTP 1.1 pipelining.
Definition: ecore_con_url.c:88
EAPI void ecore_con_url_verbose_set(Ecore_Con_Url *url_con, Eina_Bool verbose)
Toggles libcurl's verbose output.
Definition: ecore_con_url.c:1397
EAPI int ecore_con_url_shutdown(void)
Shuts down the Ecore_Con_Url library.
Definition: ecore_con_url.c:68
EAPI Ecore_Con_Url * ecore_con_url_custom_new(const char *url, const char *custom_request)
Creates a custom connection object.
Definition: ecore_con_url.c:802
struct _Ecore_Con_Url Ecore_Con_Url
Used to provide legacy API/ABI compatibility with non-Eo applications.
Definition: Ecore_Con.h:347
EAPI void ecore_con_url_additional_header_add(Ecore_Con_Url *url_con, const char *key, const char *value)
Adds an additional header to the request connection object.
Definition: ecore_con_url.c:967
@ ECORE_CON_URL_TIME_IFMODSINCE
Add the "If-Modified-Since" HTTP header, so that the request is performed by the server only if the t...
Definition: Ecore_Con.h:1739
Ecore_Event_Handler * ecore_event_handler_add(int type, Ecore_Event_Handler_Cb func, const void *data)
Adds an event handler.
Definition: ecore_events.c:13
EAPI int ecore_shutdown(void)
Shuts down connections, signal handlers sockets etc.
Definition: ecore.c:366
EAPI int ecore_init(void)
Sets up connections, signal handlers, sockets etc.
Definition: ecore.c:225
void ecore_main_loop_quit(void)
Quits the main loop once all the events currently on the queue have been processed.
Definition: ecore_main.c:1308
void ecore_main_loop_begin(void)
Runs the application main loop.
Definition: ecore_main.c:1298
#define EINA_LIST_FOREACH(list, l, _data)
Definition for the macro to iterate over a list.
Definition: eina_list.h:1415
#define EINA_TRUE
boolean value TRUE (numerical value 1)
Definition: eina_types.h:539
#define EINA_FALSE
boolean value FALSE (numerical value 0)
Definition: eina_types.h:533
unsigned char Eina_Bool
Type to mimic a boolean.
Definition: eina_types.h:527
#define EINA_UNUSED
Used to indicate that a function parameter is purposely unused.
Definition: eina_types.h:339
Used as the data param for the ECORE_CON_EVENT_URL_COMPLETE event.
Definition: Ecore_Con.h:610
Ecore_Con_Url * url_con
a pointer to the connection object
Definition: Ecore_Con.h:611
int status
HTTP status code of the operation (200, 404, 401, etc.)
Definition: Ecore_Con.h:612
Used as the data param for the ECORE_CON_EVENT_URL_DATA event.
Definition: Ecore_Con.h:598
int size
the size of the current received data (in bytes)
Definition: Ecore_Con.h:600
unsigned char data[1]
the data received on this event
Definition: Ecore_Con.h:601
Type for a generic double linked list.
Definition: eina_list.h:318