Home > OS >  How to hide get request url
How to hide get request url

Time:07-28

Any one help me how to hide particular parameter value in url .I'm using jsp,Java struts. Example: Actual url: Http://localhost:8080/getDetail?detailname=Harry&price=200&recaptcha=le3MV Expected url: Http://localhost:8080/getDetail?detailname=Harry&price=200

CodePudding user response:

If this is a form there are two methods,they are post and get method Using post method will hide the parameter unlike the get method

or

Use session variables instead of the request parameters

CodePudding user response:

Once a page is loaded, you can do some shenanigans to hide it from the URL bar and from the forward/back navigation, but it's still accessible from the browser history itself and will stay if JavaScript is disabled.

const url = new URL(window.location.href);
url.searchParams.delete("recaptcha");
window.history.replaceState({}, "", url.toString());
  • Related