Search code examples
javarestful-url

RESTful GET URL end with .0


I have a GET endpoint with the URL is api/v1/v4network/{address}. When I try with api/v1/v4network/1.1.1.0, I only get 1.1.1 value of address instead of 1.1.1.0. I also use ASCII for address, but it met the same issue.

Thanks all!


Solution

  • I have fix my problem.

    Only using PathVariable with RegEx

    I have used

    @RequestMapping(value = "/{address:.+}", method = RequestMethod.GET)
    

    and it working correctly!