Giter Site home page Giter Site logo

http-accept-headers's Introduction

http-accept-headers

Parse HTTP Accept headers in accordance with RFC 2616 (in Clojure).

About

This library intends to be 100% compliant with RFC 2616. It is web-framework agnostic and simply provides a way to go from various Accept headers to sequences of their values.

Parsers are implemented are Accept, Accept-Charset, Accept-Encoding, and Accept-Language. In all cases, you may specify what you would like to use in place of wildcard values.

Each parser returns a sequence of values corresponding to the header that can be used to provide an appropriate response. The sequence is ordered as per RFC 2616 sections 14.1-14.4, honoring the quality parameter and all other required comparisons.

It is assumed that any default values you pass in place of wildcards will be acceptible to your server, so they are not expanded into all possible combinations.

This library assumes that the server does not have a preference when it receives more than one field with the same quality value. If the server would like to have control over this, a different workflow is required."

Why?

I like standards. I get upset when I find out that developers don't honor them, and more upset when I find that the tools to honor them aren't available. I looked at the many Clojure web frameworks and routing libraries, and no one provided raw access to how to handle varying Accept headers.

This is a core library to help make your website standards compliant. If you start to face problems of being in-the-large like internationalization, this will work with you instead of get in your way.

Supported Clojure Versions

http-accept-headers is tested on Clojure 1.6.0 only.

Maturity

This is alpha quality software.

Installation

http-accept-headers is available as a Maven artifact from Clojars:

[org.tobereplaced/http-accept-headers "0.1.0"]

http-accept-headers follows Semantic Versioning. Please note that this means the public API for this library is not yet considered stable.

Documentation

Please read the Codox API Documentation. The unit tests may also be of interest.

Support

Please post any comments, concerns, or issues to the Github issues page or find me on #clojure. I welcome any and all feedback.

Changelog

v0.1.0

  • Initial Release

License

Copyright © 2014 ToBeReplaced

Distributed under the Eclipse Public License, the same as Clojure. The license can be found at LICENSE in the root of this distribution.

http-accept-headers's People

Contributors

tobereplaced avatar

Stargazers

 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.