<commit_before># About

A very simple prototype providing an HTTP interface to Redis. It uses [hiredis](https://github.com/antirez/hiredis) and [jansson](https://github.com/akheron/jansson).

<pre>
make clean all
./turnip &
curl http://127.0.0.1:7379/SET/hello/world
curl http://127.0.0.1:7379/GET/hello
→ “world”

curl -d "GET/hello" http://127.0.0.1:7379/
→ “world”

</pre>

# Ideas

* Add meta-data info per key (MIME type in a second key, for instance)
* Find a way to format multi-bulk data
* Support PUT, DELETE, HEAD?
* Add JSONP callbacks
* Add support for Redis UNIX socket
* Enrich config file
	* Provide timeout
	* Restrict commands by IP range
* Add your own here or send your suggestions on twitter [@yowgi](http://twitter.com/yowgi).

# HTTP error codes
* Missing key: 404 Not Found
* Timeout on the redis side: 503 Service Unavailable
* Unknown verb: 405 Method Not Allowed


# JSON output

The URI `/COMMAND/arg0/arg1/.../argN` returns a JSON object with the command as a key and the result as a value.

**Examples:**
<pre>
// string
$ curl  http://127.0.0.1:7379/GET/y
{"GET":"42"}

// number<commit_msg>Readme fixed.<commit_after># About

A very simple prototype providing an HTTP interface to Redis. It uses [hiredis](https://github.com/antirez/hiredis) and [jansson](https://github.com/akheron/jansson).

<pre>
make clean all
./turnip &
curl http://127.0.0.1:7379/SET/hello/world
curl http://127.0.0.1:7379/GET/hello
→ “world”

curl -d "GET/hello" http://127.0.0.1:7379/
→ “world”

</pre>

# Ideas

* Add meta-data info per key (MIME type in a second key, for instance)
* Find a way to format multi-bulk data
* Support PUT, DELETE, HEAD?
* Add JSONP callbacks
* Add support for Redis UNIX socket
* Enrich config file
	* Provide timeout
	* Restrict commands by IP range
* Send your ideas using the github tracker or on twitter [@yowgi](http://twitter.com/yowgi).

# HTTP error codes
* Missing key: 404 Not Found
* Timeout on the redis side: 503 Service Unavailable
* Unknown verb: 405 Method Not Allowed


# JSON output

The URI `/COMMAND/arg0/arg1/.../argN` returns a JSON object with the command as a key and the result as a value.

**Examples:**
<pre>
// string
$ curl  http://127.0.0.1:7379/GET/y
{"GET":"41"}

// number
{'fraction_non_alphanumeric': 0.13152028533214444, 'fraction_numerical': 0.047258136424431565, 'mean_word_length': 3.684759916492693, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1724199', 'n_tokens_mistral': 859, 'n_tokens_neox': 782, 'n_words': 280}