post<T>(url: string, body: any): Observable<T> { return this.http.post<T>(this.baseUrl + decodeURIComponent(url), body); } add(data){ return this.commonHttpService.post(`/organisations?/add`,data); } onSubmit() { const controls = this.addForm.controls; const data = { name: controls.value }; this.homeService .add(data) .pipe(catchError(err => of(err) ), tap((resp: any) => { if (resp.status_code === 200) { Swal.fire('Ensemble added successfully!', '', 'success') }
Request URL I recieved- http://X.XXX.XXX.XXX/api/organisations%E2%80%8B/add
Expected Request URL- http://X.XXX.XXX.XXX/api/organisations/add
I added the decodeURIComponent to the url but still I am getting this request url. How can we solve this? Tried many ways.
You must be out of luck. I copy/paste your code in the javascript console and it showed me an invisible character.
Try to rewrite your code by hand
1.4m articles
1.4m replys
5 comments
57.0k users