Skip to content

rendyfebry/go-user

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple HTTP Server

Usage

go run cmd/main.go

Request

Create User

curl -L -X POST 'localhost:3000/users' \
-H 'Content-Type: application/json' \
--data-raw '{
    "name": "yo",
    "email": "yo@example.com",
    "address": "Jakarta",
    "password": "password"
}'

Get All Users

curl -L -X GET 'localhost:3000/users'

Get Single User

curl -L -X GET 'localhost:3000/users/d0465c53-94a4-47c1-8e0f-45eafaa96583'

Update User

curl -L -X PUT 'localhost:3000/users/08e93f8a-316a-4e46-a416-7a12665111a0' \
-H 'Content-Type: application/json' \
--data-raw '{
    "name": "kiss",
    "email": "yo@example.com",
    "address": "Bandung",
    "password": "password"
}'

Delete User

curl -L -X DELETE 'localhost:3000/users/eb8c9481-e59f-40e6-b1dd-90b27f4de5ac'

Login

curl -L -X POST 'localhost:3000/login' \
-H 'Content-Type: application/json' \
--data-raw '{
    "email": "john@example.com",
    "password": "password"
}'

About

Simple Rest API With Go

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages