Coder Social home page Coder Social logo

ahc-clj's Introduction

Async Http Client - Clojure

Intro

ahc-clj is Async Http Client for Clojure.

It is based on Asynchronous Http Client for Java which runs on top of Netty Project.

There are three modes in witch it works:

  • Asynchronous operations When you do:
    (GET url)
        

    Result will be a clojure.core/promise that will be delivered once response is completed. This promise is a map that contains following keys:

    • :status - lazy map of status fields
      • :code - response code
      • :msg - response message
      • :protocol - protocol with version
      • :major - major version of protocol
      • :minor - minor version of protocol
    • :headers - lazy map of headers where header names are keyworded, like :server for example
    • :body - body of response, this is ByteArrayOutputStream, but you have convenience functions to convert it to string for example
    • :error if there was an error you will find Throwable here
  • Streaming When you do:
    (stream-seq :get url)
        

    Result will be ref to a map that contains promises for different stages of request processing as well as contents of map returned by functions like GET except :body will be lazy sequence of ByteArrayOutputStreams.

  • Raw mode This allows you to provide callbacks that will get triggered on Http Response events like:
    • received status line,
    • received headers,
    • received body part,
    • completed request,
    • handle error.

ahc-clj is distributed under Apache License, Version 2.0.

Sample

Requires

Clojure 1.2

Documentation

See docs. Also autodoc is available.

Progress

List of tasks to do.

ahc-clj's People

Contributors

neotyk avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.