Skip to main content

Retrieving Data (GET Method)

To read a previously stored file, use a standard HTTP GET request. The server responds with the file contents based on the token (folder) and file (filename) parameters provided in the query string.


Required Parameters

ParameterDescription
tokenFolder name (used during the POST request)
fileFilename inside the folder

Example URL

curl "http://localhost:9123/?token=device01&file=data.txt"

This will return the full contents of the file located at: ./db/device01/data.txt


Response Headers

The server sends:

  • Content-Type: value from contenttype in config.ini
  • charset: value from charcode in config.ini
  • Content-Length: actual file size in bytes

Example HTTP response header:

HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf8
Content-Length: 128

Error Responses

HTTP CodeMeaning
404File not found or missing parameters
405Method not supported (only GET & POST)

💡 Notes

  • This method is useful for reading logs, status updates, or stored CSV files.
  • You can open the link in a browser or fetch it from code.
  • Files are served as-is. You can serve any file type (CSV, TXT, JSON).