@@ -1708,11 +1708,9 @@ Remove a file.
1708
1708
1709
1709
### Bugs
1710
1710
1711
- - Recursive seems to default to true. CF: https://github.com/ipfs/go-ipfs/issues/2378
1712
-
1713
1711
+ Parameters
1714
1712
+ arg (string , required ) - File to remove.
1715
- + recursive (boolean, optional) - Recursively remove directories. Alias: r.
1713
+ + recursive (boolean, optional) - Recursively remove directories. Default: false. Alias: r.
1716
1714
+ flush (boolean, optional) - Flush target and ancestors after write. Default: true. Alias: f.
1717
1715
1718
1716
+ Request Without Arguments
@@ -1861,18 +1859,60 @@ Remove a file.
1861
1859
```
1862
1860
```
1863
1861
1862
+ + Request With Argument For Directory Without Recursive
1863
+
1864
+ '/test' here must be a directory, not a file.
1865
+
1866
+ #### curl
1867
+
1868
+ curl - i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test"
1869
+
1870
+ + Body
1871
+
1872
+ ```
1873
+ curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test"
1874
+ ```
1875
+
1876
+ + Response 500
1877
+
1878
+ + Headers
1879
+
1880
+ ```
1881
+ Access-Control-Allow-Headers : X-Stream-Output, X-Chunked-Output
1882
+ Access-Control-Expose-Headers : X-Stream-Output, X-Chunked-Output
1883
+ Content-Type : application/json
1884
+ Server : go-ipfs/0.4.0-dev
1885
+ Trailer : X-Stream-Error
1886
+ Transfer-Encoding : chunked
1887
+ Date : Thu, 03 Mar 2016 15:53:27 GMT
1888
+ Transfer-Encoding : chunked
1889
+ ```
1890
+
1891
+ + Attributes (Error)
1892
+ - Message: "/test is a directory, use -r to remove directories"
1893
+ - Code: 0
1894
+
1895
+ + Body
1896
+
1897
+ ```
1898
+ {
1899
+ "Code": 0,
1900
+ "Message": "/test is a directory, use -r to remove directories"
1901
+ }
1902
+ ```
1903
+
1864
1904
+ Request With Argument And Recursive Option
1865
1905
1866
1906
This request is dependent on there being a 'test' folder in your Files API folder.
1867
1907
1868
1908
#### curl
1869
1909
1870
- curl - i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test&recursive=true "
1910
+ curl - i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test&recursive"
1871
1911
1872
1912
+ Body
1873
1913
1874
1914
```
1875
- curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test&recursive=true "
1915
+ curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test&recursive"
1876
1916
```
1877
1917
1878
1918
+ Response 200
0 commit comments