Post mapping

Report a typo

Complete the POST mapping below. An example of a valid request to this handler is as follows:

POST http://localhost:8080/addresses?name=Alice

Java
@RestController
public class AddressController {
    private ConcurrentMap<String, Integer> addressBook = new ConcurrentHashMap<>();
	
    @PostMapping("/addresses")
    public void postAddress(_________ String name) {
        addressBook.put(name, 1);
    }		
}
Kotlin
@RestController
class AddressController {
    private val addressBook = ConcurrentHashMap<String, Int>();

    @PostMapping("/addresses")
    fun postAddress(_________ name: String) {
        addressBook[name] = 1;
    }
}
Select one option from the list
___

Create a free account to access the full topic