mirror of
https://github.com/seejohnrun/haste-server.git
synced 2024-12-26 03:57:00 +00:00
Created POST api (markdown)
parent
dcc84c47d2
commit
0ebbc8f711
1 changed files with 28 additions and 0 deletions
28
POST-api.md
Normal file
28
POST-api.md
Normal file
|
@ -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" }
|
||||||
|
```
|
Loading…
Reference in a new issue