Paramètres d'interrogation

Définition

Les paramètres de requête sont un moyen de transmettre des informations supplémentaires à un serveur web par le biais d'une URL. Ils sont ajoutés à la fin de l'URL et sont séparés par un point d'interrogation ( ?), chaque paramètre et sa valeur étant séparés par un signe égal (=).

In simpler terms, query parameters are a set of options that can be added to a web address to specify additional information about the request being made. This information can be used by the server to modify the response it sends back to the client.

For example, let's say you're using the LocationIQ API to retrieve information about a specific location. You could add query parameters to the URL to specify details like the format of the response, the language of the information, or the level of detail you want to receive.

https://us1.locationiq.com/v1/search?key=&q=Eiffel%20Tower&format=json&addressdetails=1

In this example, the query parameters are:

  • YOUR_ACCESS_TOKEN: Your LocationIQ API key
  • q: The search query, in this case "Eiffel Tower"
  • format: The format of the response, in this case JSON
  • addressdetails: The level of detail to include in the response, in this case 1 for full address details

By including these query parameters in the URL, you can customize the information that is returned by the LocationIQ API to better meet your needs.

Overall, query parameters are a powerful tool for customizing web requests and responses. They can be used to pass additional information to a server, modify the format or content of a response, and more.