Match the requests

Report a typo

Match each request with the appropriate handler

1.

Java
@PutMapping("/customers/{id}")
public void first(@PathVariable long id, @RequestParam String name) {
    customerMap.put(id, name);
}
Kotlin
@PutMapping("/customers/{id}")
fun first(@PathVariable id: Long, @RequestParam name: String?) {
    customerMap[id] = name
}

2.

Java
@PutMapping("/movies/{id}")
public void second(@PathVariable long id) {
    movieMap.put(id, 1);
}
Kotlin
@PutMapping("/movies/{id}")
fun second(@PathVariable id: Long) {
    movieMap[id] = 1
}

3.

Java
@PostMapping("/customers")
public void third(@RequestParam long id, @RequestParam String name) {
    customerMap.put(id, name);
}
Kotlin
@PostMapping("/customers")
fun third(@RequestParam id: Long, @RequestParam name: String?) {
    customerMap[id] = name
}
Match the items from left and right columns
1
2
3
PUT localhost:8080/customers/1?name=someone
PUT localhost:8080/movies/1
POST localhost:8080/customers?id=1&name=someone
___

Create a free account to access the full topic