From 0ebbc8f711f35d127524202829fe769bf323f5df Mon Sep 17 00:00:00 2001 From: John Crepezzi Date: Thu, 12 Jun 2014 11:01:59 -0700 Subject: [PATCH] Created POST api (markdown) --- POST-api.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 POST-api.md diff --git a/POST-api.md b/POST-api.md new file mode 100644 index 0000000..3d2e60d --- /dev/null +++ b/POST-api.md @@ -0,0 +1,28 @@ +## What do I send? + +There are two ways to send data up to become a paste on a haste-server: + +### Raw: + +__POST__: /documents +__Content-type__: text/plain +__Request body__: contents of paste +__Response__: _See below_ + +### Form Data: + +__POST__: /documents +__Content-type__: multipart/form-data +__Request body__: A multipart form data encoded body, with a single key named "data" which holds the paste +__Response__: _See below_ + +For more detail on the how multipart form bodies should be structured, see: +http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4 + +## What do I get back? + +A JSON document (content-type: `application/json`) containing a single Key-Value, ex: + +``` js +{ "key": "as8fj2j2n" } +``` \ No newline at end of file