Spring Boot Handling Multiple Parameters in a GET request




Spring Boot Handling Multiple Parameters in a GET request

package com.example.demo;

import java.util.Map;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController {

	@GetMapping("/sample/get")
	public Map<String, String> getRequest(@RequestParam Map<String,String> multipleParams) {
		System.out.println(multipleParams);
		return multipleParams;
	}
}


URL Pattern : /sample/get?key=value&key1=value1





























Post a Comment

Previous Post Next Post