chxuan / cpp-utils Goto Github PK
View Code? Open in Web Editor NEW:hibiscus: 一些C/C++常用封装例子
Home Page: https://github.com/chxuan/cpp-utils
License: MIT License
:hibiscus: 一些C/C++常用封装例子
Home Page: https://github.com/chxuan/cpp-utils
License: MIT License
the error info is : "m_s2" : can't find the identifier
but, works well in gcc 4.9.
I try to fix this compile error, but failed!
void sendHTTP(std::string strurl)
{
try
{
std::wstring url = StringToWString(strurl);
web::http::client::http_client_config client_config;
client_config.set_timeout(std::chrono::seconds(10000));
web::http::client::http_client client(url, client_config);
auto task = client.request(web::http::methods::POST);
}
catch (web::uri_exception)
{
std::cout << "uri_exception" << std::endl;
}
catch (web::json::details::json_error)
{
std::cout << "json_error" << std::endl;
}
catch (web::json::json_exception)
{
std::cout << "json_exception" << std::endl;
}
catch (web::web_proxy::web_proxy_mode)
{
std::cout << "web_proxy_mode" << std::endl;
}
catch (...)
{
std::cout << "sendHTTP error" << std::endl;
}
// .then([](web::http::http_response resp) {
// return resp.extract_string();
//}).then([](utility::string_t jsonStr)
//{
// return jsonStr;
//});
//task.wait();
//utility::string_t respStr = task.get();
}
int main()
{
while(true)
{
Sleep(10);
std::string URL = "http://127.0.0.1:8080/test/test.go&data="+ URLEncode("{"row":[{"test":34,"test2" : 1}, {"test":34,"test2" : 1}]}");//网址不存在
sendHTTP(URL);
}
return 0;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.