Week 4

Java Annotations

Introduction to REST

Spring Boot Setup

Writing Endpoints

Message Formats

Input Validation

Practice

Assignment

Back end Track

Under construction

<aside> 🚧

This page is currently under construction. Please check back later.

</aside>

Implementation plan:

  1. @RestController — marks a class as a REST controller
  2. @RequestMapping — base path for a controller
  3. @GetMapping — handling GET requests
  4. @PostMapping — handling POST requests
  5. @PutMapping, @PatchMapping, @DeleteMapping
  6. Path variables: @PathVariable
  7. Query parameters: @RequestParam
  8. Request bodies: @RequestBody
  9. Response bodies — automatic JSON serialization with Jackson
  10. Message formats: JSON (primary), XML and Protobuf (awareness)
  11. ResponseEntity — controlling status codes and headers
  12. Exercise: build endpoints for a simple resource

The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0

CC BY-NC-SA 4.0 Icons

*https://hackyourfuture.net/*

Found a mistake or have a suggestion? Let us know in the feedback form.