Coder Social home page Coder Social logo

micro-http's Introduction

micro-http

µHTTP is an overly simplified interface for HTTP

µHTTP is designed for human with the idea that a good standard for expressing HTTP request is essential when you do not have access to high-level tools like a full-featured web browser. The goals this standard has to focus on are:

  • to use a minimum of characters
  • to be easy to remember for a human
  • to provide an extensible syntax
  • to abstract the complexity of underlied protocol
  • to be independant of the protocol version

The grammar is still under deep reflexion.

Grammar

µHTTP is defined using extended BNF grammer.

key      = ;
value    = ;
dict     = key, ':', value, { ',', dict };
method   = 'g' | 'p' | 'p' | 'd';
ip       = ; (* see ip specification for ipv4 and ipv6 *)
domain   = { domain, '.' }, [a-Z0-9]; (* domain and subdomain *)
host     = ip | domain, ':', port;
uri      = ; (* see uri specifications *)
headers  = '%', dict;
query    = '?', dict;
body     = '&', value;
status   = 'ok' | 'not found' | '';
request  = method, host, '/', uri, [ headers ], [ query ], [ body ];
response = status, ': ', body;

Examples

Get latest reddit frontpage posts

g www.reddit.com

Search through reddit (66 characters)

g www.reddit.com/search ? q: search terms, sort: relevance, t: all 

Same request, compressed (59 characters)

g www.reddit.com/search?q:search terms,sort:relevance,t:all

Same request, using HTTP/1.1 (73 characters including the CRLF end of line)

GET www.reddit.com/search?q=search%2terms&sort=relevance&t=all HTTP/1.1

micro-http's People

Contributors

arteymix avatar

Stargazers

Rex Whitten avatar  avatar

Watchers

Rex Whitten avatar James Cloos avatar  avatar Nicolas Hurtubise 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.