Giter Site home page Giter Site logo

sony / easyhttpcpp Goto Github PK

View Code? Open in Web Editor NEW
162.0 162.0 29.0 591 KB

A cross-platform HTTP client library with a focus on usability and speed

License: MIT License

CMake 0.88% C++ 98.98% Shell 0.14%
cache cpp cross-platform http https networking

easyhttpcpp's People

Contributors

shekharhimanshu avatar virtualtim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easyhttpcpp's Issues

How can i create a long connection use this ?

Brief overview

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?

Https client sample ??

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

Status of the project

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!

Response wont get cached if request header has no-cache

Brief overview

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.

Expected behavior

Response is cached.

Actual behavior

Response is not cached.

Steps to reproduce

  • Create a request with Cache-Control: no-cache header.
  • Execute it
  • Response is not cached.

Support for custom socket?

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?

Can't build easyhttp on windows using VS2017

Brief overview

I am attempting to build easyhttpcpp on windows using the Visual Studio 2017

Expected behavior

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

Actual behavior

Should be able to build easyhttp in Visual Studio

Steps to reproduce

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

Specifications like the version of the project, operating system, or hardware etc.

VS2017 on windows 10

Can not build app with easyhttp

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 $(INCLUDES) $(SOURCES) -L/usr/local/lib/ -I/usr/local/include/ -o executable -libpp -L. -lonyx -lcurl -lpthread -lboost_system -lboost_filesystem -leasyhttp -lssl -lPocoFoundation -lPocoNet -lPocoNetSSL -lPocoUtil -lPocoCrypto -lPocoJSON

/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?

cmake error

Brief overview

Expected behavior

Could you support windows build

Actual behavior

Steps to reproduce

Specifications like the version of the project, operating system, or hardware etc.

executeAsyc relies on passed request data to be valid after returning?

Brief overview

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
}

Expected behavior

executeAsync should make a copy of all the data it needs before returning?

Actual behavior

executeAsync seems to rely on the passed data to be valid after returning.

Steps to reproduce

The code sample above should be enough.

Specifications like the version of the project, operating system, or hardware etc.

Windows 10, VS2019, conan package shared build v2.1.0

Build easyhttpcpp for Android NDK

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?

Response gets cached even if request header has no-store

Brief overview

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.

Expected behavior

Response is not cached.

Actual behavior

Response is cached.

Steps to reproduce

  • Create a request with Cache-Control: no-store header.
  • Execute it.
  • Response gets cached.

Build instructions for EasyHttp Release 2.x.x?

Brief overview

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?

Steps to reproduce

Specifications like the version of the project, operating system, or hardware etc.

EasyHttp Release 2.1.0.

Poco 1.7.9.

Windows 10 x64 on a Dell G3 laptop.

SSL error

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.