Skip to content

HlibYasieniev/application-spring-boot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

app-spring-boot

make sure that you have :

  • java 15
  • mvn 3.6.3

    point to run app

Let`s open Postman and create first POST request to login with admin_permissions and get our Bearer token

  1. curl -XPOST -H "Content-type: application/json" -d '{ "username" : "admin", "password" : "34bb" }' 'localhost:8080/login'
  2. Take bearer from headers , for each request make sure that you have AuthorizationHeader(Authorization) and TokenPrefix (Bearer token)

To test API you can use curls:

  • To save new User: curl -XPOST -H 'Authorization: Bearer' -d '{ "name" : "name", "age" : "age" }' 'localhost:8080/users'

  • To save new Article: curl -XPOST -H 'Authorization: Bearer' -d '{ "text" : "text", "colorOfArticle" : "colorOfArticle" }' 'localhost:8080/articles?userID={}'

  • To get user by count of articles: curl -XGET -H 'Authorization: Bearer' 'localhost:8080/users/{count}/articles'

  • To get users by color of articles: curl -XGET -H 'Authorization: Bearer' 'localhost:8080/users/articles?color={color}'

  • To get users by age: curl -XGET -H 'Authorization: Bearer' 'localhost:8080/users?age={age}'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors