Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

272
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!