sony / easyhttpcpp Goto Github PK
View Code? Open in Web Editor NEWA cross-platform HTTP client library with a focus on usability and speed
License: MIT License
A cross-platform HTTP client library with a focus on usability and speed
License: MIT License
Add a Makefile showing how to build SimpleHttpClient
Hi, I'm new to network programming, i want to use this library to write a simple http client. But i don't know how to create a long connection by this library, i want send multiple http request in one connection. Could someone please help me?
Hi there,
I'm interested in this library but couldn't find any samples of HTTPs (SSL) client in this repository and on the web.
Do you guys have any plans to provide ? or any hints or tips ??
Cheers
Hi,
Do you have plan to publish vcpkg package?
Hi!
Thank you for good http client library! Mostly I am interested in already implemented http client pool.
But for now I am not sure about the future of the library. Is it alive? is it planned to maintain and improve the library in the future?
Thank you!
EasyHttp wont cache a response if the request header contains Cache-Control: no-cache
directive inside it. According to RFC, a no-cache
request directive means that any available cache response should not be used satisfy the request. Caching the response is allowed however.
Response is cached.
Response is not cached.
Cache-Control: no-cache
header.Hello, I couldn't find the API for this library. Does it support passing my custom socket to it? I see that it supports okhttp3-style interceptors, so maybe it's possible?
Need help to add cookies for multiple requests. If any sample please share!
I am attempting to build easyhttpcpp on windows using the Visual Studio 2017
POCO library builds fine but easyhttp is giving issue which is highlighted in https://stackoverflow.com/questions/60628973/error-while-building-cmake-project-in-visual-studio-2017
Should be able to build easyhttp in Visual Studio
Step 1. Build POCO 1.7.9 in VS2017 using CMAKE. Builds OK. I just need to use option File->Open->Folder and then point to POCO folder "C:\test\myprivate_external\poco" . This will generate CMakeLists.txt which upon right click gives "Build" and "Install" options.
Step 2. Then try building easyHTTP in VS2017 using same steps as above but it fails. I use VS2017->File->Open->Folder and then point to "C:\test\myprivate\easyhttpcpp\easyhttpcpp-2.1.0"
I was expecting to get CMakeLists.txt like step(1) but instead i run into errors mentioned at https://stackoverflow.com/questions/60628973/error-while-building-cmake-project-in-visual-studio-2017
VS2017 on windows 10
Hi, I can not set up my makefile, I've tired after all these undefined references to something in Poco::Whatever
g++ -std=c++14 -DIBPP_LINUX
/usr/local/lib//libeasyhttp.a(SqliteOpenHelper.cpp.o): In function `easyhttpcpp::db::SqliteOpenHelper::SqliteOpenHelper(Poco::Path const&, unsigned int)':
SqliteOpenHelper.cpp:(.text+0x152): undefined reference to `Poco::Data::SQLite::Connector::registerConnector()'
Am I wrong and doing something wrong? Or there are some tricks about it?
Could you support windows build
CMakeLists.txt lies about default options here for all 3 options: https://github.com/sony/easyhttpcpp/blob/master/CMakeLists.txt#L42
Default option in the message and actual default setted to the CMake variable shall be equal
Default option in the message and actual default setted to the CMake variable shall are different
Just check https://github.com/sony/easyhttpcpp/blob/master/CMakeLists.txt#L42
First of all, apologies if I completely misunderstood this problem, the documentation and online samples are rather thin.
I am doing a fire-and-forget POST webhook call. I am calling the Postman echo server for testing. When request goes through, Postman reports content length 0 and null json in the response. Sometimes I also get a Poco::Exception occurred. [scheme=https, host=postman-echo.com] message=[Not a valid integer: 18446744073309551616]
for content length header or a segfault. Due to this weird behaviour, I suspect that executeAsync tries to use some data that has already been deallocated once the method returns from scope.
If I add a sleep or pResponseCb->waitForCompletion();
before returning from method everything works as expected.
Code is almost line by line from async sample, except it is POST instead of GET.
void post(string body) {
//init client and stuff...
easyhttpcpp::MediaType::Ptr pMediaType(new easyhttpcpp::MediaType("application/json; charset=utf-8"));
easyhttpcpp::RequestBody::Ptr pRequestBody = easyhttpcpp::RequestBody::create(pMediaType, body);
easyhttpcpp::Request::Builder requestBuilder;
easyhttpcpp::Request::Ptr pRequest = requestBuilder.setUrl("https://postman-echo.com/post")
.httpPost(pRequestBody)
.build();
easyhttpcpp::Call::Ptr pCall = pHttpClient->newCall(pRequest);
HttpClientCallback::Ptr pResponseCb = new HttpClientCallback();
pCall->executeAsync(pResponseCb);
//pResponseCb->waitForCompletion(); //this makes it work
}
executeAsync should make a copy of all the data it needs before returning?
executeAsync seems to rely on the passed data to be valid after returning.
The code sample above should be enough.
Windows 10, VS2019, conan package shared build v2.1.0
Is there any way (existing documentation or script ?) to easily compile this project for Android platform? Is cross-compiling all dependencies one by one (Poco, openssl etc...) and then at the end easyhttpcpp itself manually the only option?
on async example, public easyhttpcpp::ResponseCallback not found, why?
EasyHttp will cache response for a request even if it has Cache-Control: no-store
header. According to RFC this should not be the case.
Response is not cached.
Response is cached.
Cache-Control: no-store
header.I tried to build EasyHttp on Windows using the wiki guide. It worked for EasyHttp 1.0.0, but not for 2.0.0 or 2.1.0.
First I was getting this error:
CMake Error at C:/repo/poco/NetSSL_Win/cmake/PocoNetSSLWinConfig.cmake:5 (include):
include could not find load file:
C:/repo/poco/NetSSL_Win/cmake/PocoNetSSLWinTargets.cmake
I fixed it by changing my Poco CMake command to this:
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_NETSSL_WIN=ON ../
But now I have a new issue when I try to build:
C:\repo\easyhttpcpp\_build>cmake -DCMAKE_PREFIX_PATH="C:/repo/poco/_build" ..
-- Configuring done
CMake Warning:
Value of CMAKE_CXX_FLAGS_DEBUG contained a newline; truncating
CMake Warning:
Value of CMAKE_CXX_FLAGS_MINSIZEREL contained a newline; truncating
CMake Warning:
Value of CMAKE_CXX_FLAGS_RELEASE contained a newline; truncating
CMake Warning:
Value of CMAKE_CXX_FLAGS_RELWITHDEBINFO contained a newline; truncating
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "Poco::NetSSL" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "Poco::Crypto" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "OpenSSL::SSL" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "OpenSSL::Crypto" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "Poco::NetSSL" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "Poco::Crypto" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "OpenSSL::SSL" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "OpenSSL::Crypto" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "Poco::NetSSL" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "Poco::Crypto" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "OpenSSL::SSL" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "OpenSSL::Crypto" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "Poco::NetSSL" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "Poco::Crypto" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "OpenSSL::SSL" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "OpenSSL::Crypto" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "Poco::NetSSL" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "Poco::Crypto" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "OpenSSL::SSL" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:105 (add_library):
Target "easyhttp" links to target "OpenSSL::Crypto" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
C:\repo\easyhttpcpp\_build>
What am I doing wrong?
Get a Windows 10 x64 machine.
Check out release 2.1.0.
Follow wiki guide.
(Optional) Get rid of first error by replacing poco cmake command with cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_NETSSL_WIN=ON ../
.
Poco 1.7.9.
Windows 10 x64 on a Dell G3 laptop.
Hello,
Really this is not an issue, I'm trying to connect to an apache server with a self-signed certificate and I can't find a way to ignore this error.
Error occurred: EASYHTTPCPP-ERR-100704: SSL error occurred in sendRequest. [scheme=https, host=https://*********.com] message=[error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed]
Any suggestions on how to solve this?
Regards and thanks,
Julian Bolivar
Please add minimum documentation on how to configure logging. Suggested page:
https://github.com/sony/easyhttpcpp/wiki/Recipe:-Configuring-EasyHttp
Example:
easyhttpcpp::common::CoreLogger::getInstance()->setLoggingLevel(easyhttpcpp::common::LogLevel::LogLevelWarning);
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.