Either you want to rewrite it (so that the browser/client uses the same URL), but only the servers sees it without the trailing slash, OR you would like to emit a redirect without the trailing URL.
Also I do not want to return any response if my api get “/test/” request. I only want to return a result “/test”(without backlash) requests. How can I achieve that?