Skip to content

Instantly share code, notes, and snippets.

@metaleap
Created June 20, 2024 12:08
Show Gist options
  • Save metaleap/4c88cf2cd820ecb2d49c4c1bbec22ef7 to your computer and use it in GitHub Desktop.
Save metaleap/4c88cf2cd820ecb2d49c4c1bbec22ef7 to your computer and use it in GitHub Desktop.
;;; -*- Gerbil -*-
(import :std/error
:std/sugar
:std/io
(only-in :std/net/httpd/handler read-request-headers read-request-body))
(export main)
(def payload1 "Content-Length: 128\r\n\r\n{\"jsonrpc\":\"2.0\",\"id\":\"g0\",\"result\":[{\"uri\":\"file:///home/_/c/l\",\"name\":\"l\"},{\"uri\":\"file:///home/_/g/gerbil\",\"name\":\"gerbil\"}]}")
(def payload2 "Content-Length: 128\n\n{\"jsonrpc\":\"2.0\",\"id\":\"g0\",\"result\":[{\"uri\":\"file:///home/_/c/l\",\"name\":\"l\"},{\"uri\":\"file:///home/_/g/gerbil\",\"name\":\"gerbil\"}]}")
(def (main . args)
(def ibuf (open-buffered-reader (string->bytes payload2)))
(def headers (read-request-headers ibuf))
(displayln "HOLA")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment