Home > Software engineering >  Why url params doesn't work in some sites?
Why url params doesn't work in some sites?

Time:01-24

I'm trying to add param in the url, like in this example: https://www.google.com/ > https://www.google.com/search?q=qq Opening the last link you can see "qq" in the "q" input.

For this site it doesn't work (this is the problem): https://www.calabriasue.it/assistenza/richiesta-assistenza-e-supporto/ https://www.calabriasue.it/assistenza/richiesta-assistenza-e-supporto/?nome=mario

Can I add url param also in the last one? I need it.

Thanks!

I tried using different input names, different params ecc but it doesn't work.

CodePudding user response:

Google's server side code is designed to generate an HTML document with an input field that is prefilled with the current search term which is reads from the URL. That is why adding q=search term to the URL populates the input field.

You can't make arbitrary third-party websites prefill inputs. They have to explicitly provide a mechanism to make it possible.

CodePudding user response:

Parameters only work as long as the code for the target website is expecting to handle a parameter named "nome" with a value "mario". In the case of the google website, it is expecting a parameter named "q" and has a form input for it.

Clicking a URL sends a a GET request type, and the target site may only be accepting parameters from a POST request type. You could consider using the application known as "PostMan" to help with that.

Alternately, the target page you are viewing may be forwarded / routed from a different page which accepts parameters.

  • Related