You don't.
The HTTP verbs (GET, POST, PUT, DELETE, HEAD, and OPTIONS) are applied to a URL. They are not elements of a URL.
You can see that in your cURL example: curl -X DELETE http://localhost:8080/recipes/hi
Here the HTTP verb is DELETE
, while the URL is http://localhost:8080/recipes/hi
. Verb and URL: two different things.
In general, when you enter a URL into a browser address bar, it will issue a GET request to that URL. Browsers will issue POST requests when submitting a form on a HTML page with a method="POST"
attribute.
<form method="post" action="http://localhost:8080/submit">
If you fill in this form, the browser will submit a POST request to that URL.
Browsers will not, in the normal course of events, issue PUT, DELETE, HEAD, or OPTIONS requests. They can, but it will require scripting with javascript.