Api Endpoints

Esta sección esta sujeta a futuras modificaciones

Para documentar sus endpoints en este archivo, deben utilizar el siguiente formato:

Code

Example code.
..  http:example:: curl wget httpie
   :request: ../optional/rel/path/to/plaintext/request
   :response: ../optional/rel/path/to/plaintext/response

   Raw plaintext HTTP request example, which is
   required only when :request: is not specified.

Nota

Request and response must be separated with two or more blank lines and the first response line must start with string «HTTP/» or «HTTP «.

Result

http

POST /api/v1/user HTTP/1.1
    Host: localhost:8080
    Accept: application/json
    Content-Type: application/json
    Authorization: Basic YWRtaW46YWRtaW4=

    {
        "@type": "Document",
        "title": "My Document"
    }

curl

curl -i -X POST https://nohost/api/v1/user --data-raw '{

        "@type": "Document",

        "title": "My Document"

    }'

wget

wget -S -O- https://nohost/api/v1/user --post-data='{

        "@type": "Document",

        "title": "My Document"

    }'

httpie

echo '{

        "@type": "Document",

        "title": "My Document"

    }' | http POST https://nohost/api/v1/user

response

HTTP/1.1 201 Created
Content-Type: application/json
Location: http://localhost:8080/api/v1/user/my-document

{
    "@type": "Document",
    "id": "my-document",
    "title": "My Document"
}