Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

269
Vistas
Angular 4 http get - Removing hash from url

When making a HTTP call, Angular is chopping off the hash and everything after it.

Example:

http://sub.domain.com/api/$metadata#EndpointName

...becomes

http://sub.domain.com/api/$metadata

Haven't been able to find a way to tell Angular to NOT modify the URL. Any ideas?

Currently using Angular 4.0.0.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

First of all, the hash symbol is used to identify a location within the current document to which you want to seek, so using it to denote an endpoint on the server is semantically incorrect.

You should use query parameters for it instead of resorting to using the hash. For example, http://sub.domain.com/api/$metadata?endpoint=EndPointName

As far as I know, stripping the hash sign is angular's implementation of the Http module

over 4 years ago · Santiago Trujillo Denunciar

0

I found this:

Fragment Parameters The fragment part of the URL, everything after a hash symbol, is information that is normally used only by the client, such as a browser, and not processed by the server. Therefore it is uninteresting when discussing REST parameters. The only interesting item is if you need to send the actual hash character as a value (instead of representing the hash control symbol) to one of the options. In that case you need to encode the URL.

Character Encoding Special characters are encoded in the URL, by a mechanism called “percent encoding”. In this mechanism any character can be replaced by the percent symbol, followed by a two-digit hexadecimal value of the encoded character. If special characters (such as the hash character) need to be sent as actual data, they must be encoded. All other characters can optionally be encoded.

Here: https://www.soapui.org/testing-dojo/best-practices/understanding-rest-headers-and-parameters.html

over 4 years ago · Santiago Trujillo Denunciar
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 Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda