ChaiScript bindings to make HTTP requests
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
include/chaiscript/extras
tests
.gitignore
CMakeLists.txt
LICENSE
README.md

README.md

ChaiScript Extras Http

Provides ChaiScript bindings to make HTTP requests with http.h.

Usage

  1. Include include/chaiscript/extras/http.hpp
  2. Include the module source...
    #define HTTP_IMPLEMENTATION
    #include "../include/chaiscript/extras/http.hpp"
  3. Add the module to the ChaiScript instance...
    auto httplib = chaiscript::extras::http::bootstrap();
    chai.add(httplib);
  4. Make use of it in ChaiScript...
    var request = Http("http://example.com/index.html")
    while (request.process() == "pending") {
      print("Please Wait...")
    }
    if (request.getStatus() == "failed") {
      print("Failed: " + request.getReasonPhrase())
    }
    global response = request.getResponseString()
    print(response)
    

Development

mkdir build
cd build
cmake ..
make
make test

License

MIT