More doc, and markdown fixes.

master
Nicolas Favre-Felix 14 years ago
parent 71bc9e39f0
commit 6290378941

@ -51,12 +51,14 @@ curl -d "GET/hello" http://127.0.0.1:7379/
* Unauthorized command (disabled in config file): 403 Forbidden. * Unauthorized command (disabled in config file): 403 Forbidden.
# Command format # Command format
The URI `/COMMAND/arg0/arg1/.../argN` executes the command on Redis and returns the response to the client. GET and POST are supported: The URI `/COMMAND/arg0/arg1/.../argN.ext` executes the command on Redis and returns the response to the client. GET and POST are supported:
* `GET /COMMAND/arg0/.../argN` * `GET /COMMAND/arg0/.../argN.ext`
* `POST /` with `COMMAND/arg0/.../argN` in the HTTP body. * `POST /` with `COMMAND/arg0/.../argN` in the HTTP body.
Special characters: `/` and `.` have special meanings, `/` separates arguments and `.` adds a file extension to change the Content-Type. They can be replaced by `%2f` and `%2e`, respectively. `.ext` is an optional extension; it is not read as part of the last argument but only represents the output format. Several formats are available (see below).
Special characters: `/` and `.` have special meanings, `/` separates arguments and `.` changes the Content-Type. They can be replaced by `%2f` and `%2e`, respectively.
# ACL # ACL
Access control is configured in `webdis.json`. Each configuration tries to match a client profile according to two criterias: Access control is configured in `webdis.json`. Each configuration tries to match a client profile according to two criterias:
@ -118,7 +120,6 @@ $ curl http://127.0.0.1:7379/MAKE-ME-COFFEE
// JSONP callback: // JSONP callback:
$ curl "http://127.0.0.1:7379/TYPE/y?jsonp=myCustomFunction" $ curl "http://127.0.0.1:7379/TYPE/y?jsonp=myCustomFunction"
myCustomFunction({"TYPE":[true,"string"]}) myCustomFunction({"TYPE":[true,"string"]})
</pre> </pre>
# RAW output # RAW output
@ -149,22 +150,21 @@ $ curl http://127.0.0.1:7379/TYPE/y.raw
// error, which is basically a status // error, which is basically a status
$ curl http://127.0.0.1:7379/MAKE-ME-COFFEE.raw $ curl http://127.0.0.1:7379/MAKE-ME-COFFEE.raw
-ERR unknown command 'MAKE-ME-COFFEE' -ERR unknown command 'MAKE-ME-COFFEE'
</pre> </pre>
# Custom content-type # Custom content-type
Several content-types are available: Several content-types are available:
* `.json` for `application/json` (this is the default Content-Type). * `.json` for `application/json` (this is the default Content-Type).
* `.txt` for `text/plain` * `.txt` for `text/plain`
* `.html` for `text/html` * `.html` for `text/html`
* `xhtml` for `application/xhtml+xml` * `xhtml` for `application/xhtml+xml`
* `xml` for `text/xml` * `xml` for `text/xml`
* `.png` for `image/png` * `.png` for `image/png`
* `jpg` or `jpeg` for `image/jpeg` * `jpg` or `jpeg` for `image/jpeg`
* Any other with the `?type=anything/youwant` query string. * Any other with the `?type=anything/youwant` query string.
<pre> <pre>
curl -v "http://127.0.0.1:7379/GET/hello.html" # the key is “hello” here, not “hello.html” curl -v "http://127.0.0.1:7379/GET/hello.html"
[...] [...]
&lt; HTTP/1.1 200 OK &lt; HTTP/1.1 200 OK
&lt; Content-Type: text/html &lt; Content-Type: text/html
@ -173,7 +173,22 @@ curl -v "http://127.0.0.1:7379/GET/hello.html" # the key is “hello” here, no
&lt; &lt;
&lt;!DOCTYPE html&gt; &lt;!DOCTYPE html&gt;
&lt;html&gt; &lt;html&gt;
... [...]
&lt;/html&gt; &lt;/html&gt;
curl -v "http://127.0.0.1:7379/GET/hello.txt"
[...]
&lt; HTTP/1.1 200 OK
&lt; Content-Type: text/plain
&lt; Date: Mon, 03 Jan 2011 20:43:36 GMT
&lt; Content-Length: 137
[...]
curl -v "http://127.0.0.1:7379/GET/big-file?type=application/pdf"
[...]
&lt; HTTP/1.1 200 OK
&lt; Content-Type: application/pdf
&lt; Date: Mon, 03 Jan 2011 20:45:12 GMT
[...]
</pre> </pre>

Loading…
Cancel
Save