My_conn_ =evhttp_connection_base_new (Ev_base_,ev_dns_,host,port); - - the - structEvhttp_request *Http_req; WuyiHttp_req = Evhttp_request_new (Rspcallback, (void*) arg);//Rspcallback Receiving Messages the structEvkeyvalq *head =evhttp_request_get_output_headers (http_req); - -Evhttp_add_header (Head,"user-agent","My Device"); AboutEvhttp_add_header (Head,"Connection","keep-alive"); $ Charbuf[ -]; -snprintf (BUF, the,"%d", Req.terminaltype); -Evhttp_add_header (Head,"Terminaltype", BUF); -Evhttp_add_header (Head,"Versioninfo", Req.version_info.c_str ()); AEvhttp_add_header (Head,"osinfo", Req.osinfo.c_str ()); +Evhttp_add_header (Head,"despasswd", Req.despasswd.c_str ()); the theEvhttp_add_header (Head,"Host", host); the the intret = Evhttp_make_request (My_conn_,http_req,evhttp_req_put,"/myurl"); theEvhttp_uri_free (URI);
Implementation of Libevent HTTP client