Git Product home page Git Product logo

rxhttp's Introduction

rxhttp

Clojars Project

Introduction

A stream based http client for Clojure and ClojureScript that works in browser, nodejs and JVM; and uses beicon as reactive streams abstraction.

Installation

Add the following dependency into your project.clj file:

[funcool/rxhttp "1.0.0"]

Getting started

This library just consists in one public namespace with one public method:

(require '[rxhttp.core :as http]
         '[beicon.core :as rx])

(-> (http/send! {:method :get :url "https://httpbin.org/get"})
    (rx/subscribe (fn [{:keys [status headers body] :as response}]
                    (println "Response:" response))))

That's it, nothing more. You can see all available options in the send! function docstring.

On JVM platform you also have a send!! function, that is a synchronous variant of send!.

How to contribute?

Just open an issue if you found an error or unexpected behavior or if you want discuss some additional feature. If you found some unexpected behavior and you have time to fix it, please open a PR!

FAQ

  • Why an other http client library?

Because I need and want to handle the response with reactive streams and that abstraction allows easy way to abort/cancel a ingoing request. A promise based solutions does allow that because promise abstracion is not cancellable.

This library does not intend to reinvent the wheel, it just the well established libraries under the hood and exposes an uniform api for all platforms..

  • Is this library a replacement for httpurr?

Yes. Reactive-Streams provide a better abstraction for represent an asynchronous result; they are cancellable and lazy.

License

rxhttp is licensed under MPL-2.0 license.

rxhttp's People

Contributors

niwinz avatar

Watchers

Josef Pospíšil avatar James Cloos avatar

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.