advanced-data-processing-company / vincent

high performance RESTFUL cpp server framework
0 stars 0 forks source link

http API can use protobuf directly #4

Open maidamai0 opened 5 years ago

maidamai0 commented 5 years ago

example code like this:

// server
Server srv;

// create http client
HttpClient cl(srv);

// update data
ProtobufData update_data;
cl.put(udate_data);

// create data
ProbufData create_data;
cl.post(create_data);

// retrive data
Url get_path = "some/data/can/be/convert/to/protobuf";
ProtobufData get_data = cl.get(get_path, );

// dalete data
Url del_path  = "something/to/be/deleted";
cl.delete(delete_path);

Please use smart pointer to manage memory.

maidamai0 commented 5 years ago

@lee64456546

ghost commented 5 years ago

previous problems: 1.no path when updating data, creating data, retriving data

changed contents like below:

// update data
ProtobufData update_data;
cl.put(url, update_data);

// create data
ProbufData create_data;
cl.post(url, create_data);

// retrive data
Url get_path = "some/data/can/be/convert/to/protobuf";
ProtobufData get_data = cl.get(get_path);