First of all we need to add a Maven dependency for Apache Http Client
Apache Http Client Maven dependency
We usually use PUT Http request to update data on the server for example a user.
DELETE Http request is used to delete something for example a user.
PUT HTTP Request
DELETE HTTP Request
Here url is the url of the web service endpoint for example https://www.user-service-example.com/api/users/{id}. {id} is the unique userId of the user that you want to update (PUT request) or delete (DELETE request).
PUT Http request should contain the info to update the existing user.
DELETE Http request doesn’t have any payload.