Q: Grails Restful webservice using URL mappings I am using Grails 3 version for building RESTFUL web services and followed the below steps to provide the API to validate user. Instead of json response getting the login url Of application, please let me know if I miss any steps
STEP 1. Created controler which extends RestfulController
class MyExampleController extends RestfulController {
static responseFormats = ['json', 'xml']
MyExampleController() {
    super()
}

UserService userService

static allowedMethods = [
        index        : ["POST", "GET"],
        history      : ["GET", "POST"],
        validateUser      : ["GET"]
]

def index() { }

def validateUser() {
    println "User........${params.uid}"
    String userName = params.uid
    Map info = userService.getUserInfo(userName)
    if (!info) {
        render status: org.springframework.http.HttpStatus.NOT_FOUND
        return
    }
    render info as JSON

}

}
Step 2 : In the URL Mappings.groovy file added below line
"/roomCheckAPI/login/$uid?"(controller: "myExample",action:"validateUser")
Using below curl request to see the json response, but getting the login url of the application
curl -v -g -k https://localhost:8444/appName/roomCheckAPI/login/user1
Response: Redirecting to login  URL of application instead of json response
