]> Nishi Git Mirror - libw3.git/commitdiff
better
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Fri, 9 Feb 2024 23:10:08 +0000 (23:10 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Fri, 9 Feb 2024 23:10:08 +0000 (23:10 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@197 d27a3e52-49c5-7645-884c-6793ebffc270

Python/LibW3/__init__.py [moved from Python/__init__.py with 100% similarity]
Python/test.py [new file with mode: 0644]

similarity index 100%
rename from Python/__init__.py
rename to Python/LibW3/__init__.py
diff --git a/Python/test.py b/Python/test.py
new file mode 100644 (file)
index 0000000..804de01
--- /dev/null
@@ -0,0 +1,21 @@
+from LibW3 import w3, libw3
+
+def data_handler(w3cli, data, size):
+       print(data)
+
+def header_handler(w3cli, key, value):
+       print("`" + key + "`: `" + value + "`")
+
+def status_handler(w3cli, status):
+       print("Status: " + str(status))
+
+libw3.init()
+w3cli = w3("http", "localhost", 1024)
+w3cli.set_path("/")
+w3cli.set_method("GET")
+w3cli.set_data_handler(data_handler)
+w3cli.set_header_handler(header_handler)
+w3cli.set_status_handler(status_handler)
+w3cli.set_read_size(2048)
+w3cli.send_request()
+w3cli.destroy()