• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

156
Vistas
When to use and when not to use encodeURIComponent or encodeURI?

In a security standpoint, when should I use encodeURIComponent or encodeURI and when I don't need to use it?

Do I need to use encodeURI on "https://nominatim.openstreetmap.org/search.php?q=" as shown below?

Do I need to encodeURIComponent each key in the query string, like polygon_geojson and format?


And do I need to use them on only GET or also on POST method? On another posted question, there were mixed answers.

$.get(
"https://nominatim.openstreetmap.org/search.php?q=" +
  encodeURIComponent(query) +
  "&polygon_geojson=1&format=jsonv2",
function (response) {
  if (response.length > 0) {
    var latlng = new L.LatLng(response[0].lat, response[0].lon);

    marker.setLatLng(latlng);
    map.panTo(latlng);
    acadp_update_latlng(response[0].lat, response[0].lon);
  }
},
"json"
);
almost 3 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda