print_request(request); //const char *uri=evhttp_request_get_uri(request); struct evbuffer *buffer=evbuffer_new(); //evbuffer_add(buffer,"coucou !",8); evbuffer_add_printf(buffer,"Hello World!"); evhttp_add_header(evhttp_request_get_output_headers(request),"Content-Type","test/plain");...
headers = evhttp_request_get_output_headers(req);evhttp_add_header(headers,"Host", hostname_port);evhttp_add_header(headers,"Connection","close");/*evhttp_add_header(headers, "User-Agent", "***");*/returnevhttp_make_request(d->desc_conn, req, EVHTTP_REQ_GET, path); } 开发者ID:min...
}/* add headers */evhttp_add_header(evhttp_request_get_output_headers(req),"Content-Type","application/json");/* send the response */evhttp_send_reply(req,200,"OK", evb);exit:if(decoded) evhttp_uri_free(decoded);if(evb) evbuffer_free(evb); } 开发者ID:pearsonalan,项目名称:stats,代...
req[0]=evhttp_request_new(http_request_empty_done,data->base); req[1]=evhttp_request_new(http_request_empty_done,data->base); /* Add the information that we care about */ evhttp_add_header(evhttp_request_get_output_headers(req[0]),"Host","somehost"); ...
HTTP_name2method={'GET':0,'POST':1,'HEAD':2} cdefexternfrom"evhttp.h": structevhttp_t"evhttp": pass structevkeyvalq: pass structevhttp_request: evkeyvalq*input_headers evkeyvalq*output_headers char*remote_host shortremote_port intkind ...
upstack; freeing must be deferred*/#defineEVHTTP_REQ_DEFER_FREE 0x0008/** The request should be freed upstack*/#defineEVHTTP_REQ_NEEDS_FREE 0x0010structevkeyvalq *input_headers;structevkeyvalq *output_headers;/*address of the remote host and the port connection came from*/char*remote_host...
_request*remote_rsp,void*arg){fprintf(stderr,"< HTTP/1.1 %d %s\n",evhttp_request_get_response_code(remote_rsp),evhttp_request_get_response_code_line(remote_rsp));structevkeyvalq*headers=evhttp_request_get_input_headers(remote_rsp);structevkeyval*header;TAILQ_FOREACH(header,headers,next){...
private void RequestHandler(EventHttpRequest req) { ThreadPool.QueueUserWorkItem(_ => { var headers = new Dictionary<string,string>(){{ "Content-Type","text/html; charset=utf-8" }}; var msg = Encoding.UTF8.GetBytes("<h1>Hello World</h1>"); ...
*/req = evhttp_request_new(http_dispatcher_test_done,NULL);if(req ==NULL) {fprintf(stdout,"FAILED\n");exit(1); }/* Add the information that we care about */evhttp_add_header(req->output_headers,"Host","somehost");if(evhttp_make_request(evcon, req, EVHTTP_REQ_GET,"/?arg=val"...