The problem is that you are using a POST request and you need to be sending more than one parameter when they are post request. If you notice you are passing a parameter to the updateShortUrl method but you are never using it either.
updateShortUrl(data: ShortUrl): Observable<any> {
return this._http.put('https://jsonplaceholder.typicode.com/posts/1', YOUR_PARAMETER_HERE).pipe(map((res) => {
return res;
}));
}
Also, remember using 'any' is not good practice. By you using .pipe will always return an observable so no need to repeat yourself by putting any. Another thing is if you aren't doing anything with the request that is coming back, you don't need to use pipe. You can have something like this:
updateShortUrl(data: ShortUrl) {
return this._http.put('https://jsonplaceholder.typicode.com/posts/1', YOUR_PARAMETER_HERE);
}
The best practice will be for you to create a module that specifies the kind of Observable you are getting
export class Post {
userId: number,
id: number,
title: string,
body: string
constructor(private userId: number, private id: number, private title: , private body: string) {
this.userId= userId;
this.id= id;
this.title = title
this.body = body
}
}
And you use it the following way:
updateShortUrl(data: ShortUrl) Observable<Post> {
return this._http.put('https://jsonplaceholder.typicode.com/posts/1', YOUR_PARAMETER_HERE);
}
Also, I notice you are using that jsonplaceholder to test you app. You can always use JSON-SERVER https://www.npmjs.com/package/json-server