cURL – PUT request examples
By:Roy.LiuLast updated:2019-08-11
Example to use cURL -X PUT to send a PUT (update) request to update the user’s name and email.
Terminal
$ curl -X PUT -d 'name=mkyong&email=abc@gmail.com' http://localhost:8080/user/100
If the REST API only accepts json formatted data, try this
Terminal
$ curl -X PUT -H "Content-Type: application/json" -d '{"name":"mkyong","email":"abc@gmail.com"}' http://localhost:8080/user/100
References
From:一号门
COMMENTS