User Manager
Endpoint: /users
Request
HTTP verbs: http://www.restapitutorial.com/lessons/httpmethods.html
POST: create
required fields
optional fields
none
GET: read
- single user:
/users/{id}
- users:
/users
required fields
none
optional fields
DELETE: delete
- single user:
/users/{id}
- users:
/users
required fields
none
optional fields
PUT: update (replacement)
required fields
optional fields
none
PATCH: partial update
required fields
optional fields
Response
single resource
{
"data": {
"type": "users",
"id": "1",
"attributes": {
"name": "john",
"email": "john@thesmithcompany.com",
"password": "ja8q\+Y!?FCD3":P"
}
}
}
multiple resources
{
"data": [{
"type": "users",
"id": "1",
"attributes": {
"name": "john",
"email": "john@thesmithcompany.com",
"password": "ja8q\+Y!?FCD3\":P"
}
},
{
"type": "users",
"id": "2",
"attributes": {
"name": "bob",
"email": "bob@hello.co.uk",
"password": "ja8q\+Y!?FCD3(:P"
}
}]
}
Installation
The dependencies of this project are stored inside the vendor/
folder. While we use gvt
to manage the dependencies, we're also pushing them anyway, so that users can feel free to simply run go get
to
get the dependencies.
Keep in mind that the vendor/
folder can only be used for dependencies out-of-the-box if you're running Go 1.6 or higher.
It is also available on Go 1.5 but you will need to enable the environment variable
GO15VENDOREXPERIMENT
and set it to 1
.