0

plus character is converting to space character when using HttpParams() in angular 6.

Is there any solution like using other methods in angular for setting http request params without encoding the stringified json or without replacing + with %2B .

this.http.post(URl, testReqFormat, { headers: headers }).subscribe(
   data => {
     console.log("Test request success :: ", data);

   }, 
   error => {
     console.log("Test request failed :: ", error);

   });
Goutham R
  • 47
  • 6
  • Check this link if it answers : https://stackoverflow.com/questions/45428842/angular-url-plus-sign-converting-to-space – Gaurav Tyagi Sep 10 '19 at 12:29

1 Answers1

0

You need to escape special character.

Add \ before +

Adrita Sharma
  • 19,704
  • 10
  • 55
  • 71
  • Will do that. ........ is there any other method in angular which do not replace while setting the params ? – Goutham R Sep 10 '19 at 12:29