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.
1Warning - please do not use obscenities in your posts. I've removed it for you. Note that other users may have flagged your post as "rude or abusive" leading to possible rep loss or suspension. Please read Be Nice: "Avoid vulgar terms and anything sexually suggestive" – DavidPostill – 2016-03-23T10:38:30.243
Issues specific to programming and software development are off topic, see On-Topic. Try [SO] but please first read How do I ask a good question?.
– DavidPostill – 2016-03-23T10:39:30.280