File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -722,6 +722,34 @@ Second argument for FTP posts can be anything that can be casted to `ubyte[]` or
722722If the path in the post request doesn't exist, it will try to create all the required directories.
723723As with HTTP, you can call several FTP requests using the same ` Request ` structure - it will reuse established connection (and authorization as well).
724724
725+ ### FTP LIST command ###
726+
727+ To retrieve single file properties or directory listing use ` rq.execute ` method:
728+ ``` d
729+ import std.stdio;
730+ import requests;
731+
732+ void main()
733+ {
734+ auto rq = Request();
735+ auto rs = rq.execute("LIST", "ftp://ftp.iij.ad.jp/pub/FreeBSD/");
736+ writeln(rs.responseBody);
737+
738+ }
739+
740+ output:
741+
742+ -rw-rw-r-- 1 ftp ftp 35 May 12 09:00 TIMESTAMP
743+ drwxrwxr-x 9 ftp ftp 169 Oct 05 2015 development
744+ -rw-r--r-- 1 ftp ftp 2871 May 11 10:00 dir.sizes
745+ drwxrwxr-x 22 ftp ftp 8192 May 09 23:00 doc
746+ drwxrwxr-x 6 ftp ftp 92 Jan 10 21:38 ports
747+ drwxrwxr-x 12 ftp ftp 237 Feb 06 2021 releases
748+ drwxrwxr-x 12 ftp ftp 237 May 05 18:00 snapshots
749+
750+ ```
751+
752+
725753### Interceptors ###
726754
727755Interceptors provide a way to modify, or log, or cache request. They can form a chain attached to Request structure so that
You can’t perform that action at this time.
0 commit comments