command
module
Version:
v0.0.0-...-9438e6f
Opens a new window with list of versions in this module.
Published: Aug 3, 2017
License: MIT
Opens a new window with license information.
Imports: 15
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Blog API
A simple and unsecure API to store blog data. The server limit the number of request
from an IP at 264 per minute.
Store Article
Add an article in the database.
-
URL:
/article/{id}/
-
Method:
POST
-
URL Param:
required:
id=[string]
represents an user ID
-
Data Param:
{
"title": "My Article",
"content": "Whatever I want to say!"
}
-
Success Response:
Code: 200 OK
Content:
{
"title": "My Article",
"content": "Whatever I want to say!"
}
-
Error Response:
Code: 400 Bad Request
Content: error as plain/text
Code: 500 Internal Server Error
Content: error as plain/text
Get Article
Get an article from the database.
-
URL:
/article/{id}/{title}
-
Method:
GET
-
URL Param:
required:
id=[string]
represent an user ID
title=[string]
represent the title of an article
-
Data Param:
None
-
Success Response:
Code: 200 OK
Content:
{
"title": "My Article",
"content": "Whatever I want to say!"
}
Delete Article
Delete an article from the database.
-
URL:
/article/{id}/{title}
-
Method:
DELETE
-
URL Param:
required:
id=[string]
represent an user ID
title=[string]
represent the title of an article
-
Data Param:
None
-
Success Response:
Code: 200 OK
Content: None
-
Error Response:
Code: 400 Bad Request
Content: error as plain/text
Code: 404 Not Found
Content: error as plain/text
Code: 500 Internal Server Error
Content: error as plain/text
Get All Article
Get all article from an user.
-
URL:
/articles/{id}/{order}/
-
Method:
GET
-
Headers:
optional:
Accept: text/xml
ask the server to send data as XML
-
URL Param:
required:
id=[string]
represent an user ID
optional:
order=[desc|asc]
ask the server to order in an ascending or descending way
-
Data Param:
None
-
Success Response:
Code: 200 OK
Content:
[{
"title": "My Article",
"content": "Whatever I want to say!"
},{
"title": "My Other Article",
"content": "Whatever I want to add!"
}]
-
Error Response:
Code: 400 Bad Request
Content: error as plain/text
Code: 404 Not Found
Content: error as plain/text
Code: 500 Internal Server Error
Content: error as plain/text
Delete All Article
Delete all article from an user.
-
URL:
/articles/{id}/
-
Method:
DELETE
-
URL Param:
required:
id=[string]
represent an user ID
-
Data Param:
None
-
Success Response:
Code: 200 OK
Content: None
-
Error Response:
Code: 400 Bad Request
Content: error as plain/text
Code: 404 Not Found
Content: error as plain/text
Code: 500 Internal Server Error
Content: error as plain/text
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.