How to do a PUT request with curl?

前端 未结 5 1630
难免孤独
难免孤独 2020-12-02 04:18

How do I test a RESTful PUT (or DELETE) method using curl?

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-02 04:59

    An example PUT following Martin C. Martin's comment:

    curl -T filename.txt http://www.example.com/dir/
    

    With -T (same as --upload-file) curl will use PUT for HTTP.

提交回复
热议问题