Skip to content

dustins/spring-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run

> ./gradlew bootRun

Helpful Commands

Format Responses

If you install the linux command line tool jq you can pipe all the responses to that tool and have the JSON formatted properly.

Before

> curl --silent -H"Accept: application/json" http://localhost:8080/users
{"content":[],"pageable":{"sort":{"empty":true,"sorted":false,"unsorted":true},"offset":0,"pageNumber":0,"pageSize":20,"paged":true,"unpaged":false}...}

After

> curl --silent -H"Accept: application/json" http://localhost:8080/users | jq
{
  "content": [],
  "pageable": {
    "sort": {
      "empty": true,
      "sorted": false,
      "unsorted": true
    },
    "offset": 0,
    "pageNumber": 0,
    "pageSize": 20,
    "paged": true,
    "unpaged": false
  },
  ...
}

List Users

curl --silent -H"Accept: application/json" http://localhost:8080/users

Create User

curl --silent -H"Accept: application/json" -H"Content-Type: application/json" -XPOST --data-raw '{"username":"dustin","password":"apple"}' http://localhost:8080/users

Authenticate

curl --silent -H"Accept: application/json" -H"Content-Type: application/json" -XPOST --data-raw '{"username":"dustin","password":"apple"}' http://localhost:8080/users/authenticate

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages