Arc Forumnew | comments | leaders | submitlogin
HTTP Request in ARC
4 points by tug 48 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 48 days ago | link

this seems to be part of it

https://github.com/arclanguage/anarki/blob/b700e02f1442b6f56...

reply

1 point by akkartik 48 days ago | link

Indeed. Here's an example:

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

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

reply