Arc Forumnew | comments | leaders | submitlogin
HTTP Request in ARC
4 points by tug 654 days ago | 2 comments
simply looking for an example of an HTTP GET req via arc. this works in racket but having trouble dealing with loading .scm files into arc

(require net/url) (require json)

(define (get-txt url) (call/input-url (string->url url) get-pure-port (compose port->string)))

2 points by tug 654 days ago | link

this seems to be part of it


1 point by akkartik 654 days ago | link

Indeed. Here's an example:

    arc> (load "lib/client.arc")

    arc> (mkreq "")
    '(("HTTP/1.0 200 OK"
       "Cache-Control: max-age=604800"