Hi Alex,

Web.l is a server-side framework.

This thread is about how to handle a uploaded JSON file I believe,
not about consuming a JSON/REST API as a client.

Web.l is an alternative to the picolisp standard GUI framework form.l.

I can recommend web.l for people learning how to implement a HTTP server, and for small (toy) applications. It's a simple/simplified HTTP server, and the code is pretty transparent. I do not recommend to use web.l for larger or critical production applications - I think it just makes it too easy to program severe stability issues and security holes with it.

In practice you like to program your own webserver and stack (as I did/do), then web.l might be a good basis to start from, but you will end up with your own implementations anyway. Or you don't want to be bothered with webserver internals and just need a framework for writing an application - then stay with picolisp standard form.l.
That would be my sincere recommendation.

Kind regards,
beneroth


Am 2019-05-15 09:08, schrieb Alexander Burger:
Hi Andreas,

On Wed, May 15, 2019 at 08:27:19AM +0200, andr...@itship.ch wrote:
In web.l framework, you you define a request handler using (dh).

I do not know the web.l framework, but like to add that using either 'client'
(from "@lib/http.l") or @bin/ssl is a bit simpler.

'client' can handle POSTs, but no HTTPS. @bin/ssl handles HTTPS, but no POSTs.
In case you need both, I recommend a pipe to curl again.

'client' and @bin/ssl are used roughly the same way. An example for parsing
bitcoin rates would be:

   (load "@lib/json.l")

   (scl 2)

   (in '("@bin/ssl" "blockchain.info" 443 "de/ticker")
      (while (line))  # Skip header
      (readJson) )

☺/ A!ex

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to