0

I want to send a link in url, e.g.

https://localhost:8080/https://www.google.com

However, this solution does not work

@GetMapping("/{url}")
public void writeUrl(@PathVariable String url) {
    System.out.println(url);
}

I need to in the @PathVariable or @RequestParam (not in @Body)

user3794273
  • 91
  • 1
  • 1
  • 11
  • See [How to handle requests that includes forward slashes (/)?](https://stackoverflow.com/questions/31421061/how-to-handle-requests-that-includes-forward-slashes) – Michał Ziober Mar 10 '19 at 21:35

1 Answers1

0
@GetMapping("/")
public void writeUrl(@RequestParam("url") String url) {
    System.out.println(url);
}

then:

https://localhost:8080/?url=https://www.google.com