- This is simple API with array as data storage and use
net/httpgolang package to build the API. - Run this project with:
go run main.go
- List endpoints :
POST /userto create new user data
This endpoints will return a 400 http response status code if there is no input data.
This endpoints also return a 200 http response status code if the endpoints success input the data in the array.GET /usersto get all user data
This endpoints will return a 404 http response status code if there is no data in the array.
This endpoints also return 200 http response statuscode and data if there is data in the array.GET /user/{id}to get spesific user data
This endpoints will return a 404 http response status code if there is no data with the associate id.
This endpoints also return 200 http response status code and the user data with the associate if there is data in the arrayPUT /user/{id}to update spesific user data
This endpoints will return a 404 http response status code if there is no data with the associate id and there is no input.
This endpoints also return a 200 http response status code if the endpoints success update the user data with the associate id in the array.DELETE /user/{id}to delete spesific user data
This endpoints will return a 404 http response status code if there is no data in the array
This endpoints also return a 200 http response status code if the endpoints success delete the user data with the associate id in the array
- Acknowledgement:
-
Notifications
You must be signed in to change notification settings - Fork 0
ella-learn/Simple-API-with-Array
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
Simple API using net/http & array as data storage
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published