Fix variable name in spawn function. Added working with json, upload examples and install&configuration documentation

This commit is contained in:
Héctor Hurtado
2019-11-20 16:33:11 +01:00
parent 25d9f1c1ef
commit a65eb102b2
5 changed files with 108 additions and 3 deletions
+20
View File
@@ -0,0 +1,20 @@
Upload a file
=============
HTTP request allows us to send and receive files by using the Multipart standard.
Kapow! allow us to handle files received in the request. In this example we
respond back with the line count of the file received in the request.
.. code-block:: bash
fname=$(kapow get /request/files/myfile/filename)
lcount=$(kapow get /request/files/myfile/content | wc -l)
kapow set /response/status 200
echo "$fname has $lcount lines" | kapow set /response/body
You can try this by using the following curl:
.. code-block:: bash
curl -F "myfile=@README.rst" http://localhost:8080/linecount