Skip to content

mihailstoynov/rest-spring-hateoas

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

README

Vote

Get vote

GET http://127.0.0.1:8080/polls/1/alternatives/1/votes/1
Accept:application/hal+json
#!json
{
    "voteId": 1,
    "email": "[email protected]",
    "_links": {
        "self": {
            "href": "http://127.0.0.1:8080/polls/1/alternatives/1/votes/1"
        },
        "votesCount": {
            "href": "http://127.0.0.1:8080/polls/1/alternatives/1/votes/count"
        }
    }
}

Create vote

Request

POST http://127.0.0.1:8080/polls/1/alternatives/1/votes/1
Content-Type:application/json
Accept:application/hal+json
#!json
{
  "email" : "[email protected]"
}

Response: 201 CREATED

#!json
{
    "voteId": 1,
    "email": "[email protected]",
    "_links": {
        "self": {
            "href": "http://127.0.0.1:8080/polls/1/alternatives/1/votes/1"
        },
        "votesCount": {
            "href": "http://127.0.0.1:8080/polls/1/alternatives/1/votes/count"
        }
    }
}

Votes Count

GET http://127.0.0.1:8080/polls/1/alternatives/1/votes/count

Response: 200 OK

3

This README would normally document whatever steps are necessary to get your application up and running.

What is this repository for?

How do I get set up?

  • Summary of set up
  • Configuration
  • Dependencies
  • Database configuration
  • How to run tests
  • Deployment instructions

Contribution guidelines

  • Writing tests
  • Code review
  • Other guidelines

Who do I talk to?

  • Repo owner or admin
  • Other community or team contact

About

Simple example how Spring HATEOAS could be used.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published