How do I test a RESTful PUT (or DELETE) method using curl?
相关问题
- Angular RxJS mergeMap types
- Design RESTful service with multiple ids
- Axios OPTIONS instead of POST Request. Express Res
- Plain (non-HTML) error pages in REST api
- Google Apps Script: testing doPost() with cURL
相关文章
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
- Is a unicode user agent legal inside an HTTP heade
- Got ActiveRecord::AssociationTypeMismatch on model
- Multiple parameters in AngularJS $resource GET
- git: retry if http request failed
- Flutter - http.get fails on macos build target: Co
- Global Exception Handling in Jersey & Spring?
- Programmatically scraping a response header within
Using the
-X
flag with whatever HTTP verb you want:This example also uses the
-d
flag to provide arguments with your PUT request.You can use the POSTMAN app from Chrome Store.
In a single line, the curl command would be:
a) If sending form data:
b) If sending raw data as json:
c) If sending a file with a POST request:
For the request with other formats or for different clients like java, PHP, you can check out POSTMAN/comment below.
An example PUT following Martin C. Martin's comment:
With
-T
(same as--upload-file
) curl will use PUT for HTTP.where,
X - option to be used for request command
d - option to be used in order to put data on remote url
URL_PATH - remote url
new_value - value which we want to put to the server's key