Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

273
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda