Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.forth    |    Forth programmers eat a lot of Bratwurst    |    117,927 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 117,628 of 117,927    |
|    okflo@teletyp.ist to okflo@teletyp.ist    |
|    Re: making http request with gforth    |
|    18 Oct 25 20:34:59    |
      okflo@teletyp.ist writes:              > hi forthers,       >       > I am trying to do a (very simple and naive) http-request       > with gforth (current from git):       > [...]              Hi,              following up to my own post, I did nearly a year ago:              Some days ago I came back to forth and finally grasped the ffi of       gforth. Great stuff - especially the simple way to make c-callbacks!              Gforth's documentation doesn't include any example, so - perhaps my       implementation, see below, helps someone else. See also at       https://teletyp.ist/blog/entries/Doing-http-requests-with-gforth       and-libcurl.html       for web-reference.              Let me also address some questions to the experienced forthers:              - I use global variables (in the dictionary) for curl-data and        response-code. What would be the right way to do this locally in        http-request? The usual locals are on a stack IMHO - so I would need        to allocate cells?       - What is the best way, to convert an sstring to a cstring? I was        wondering, that there is a cstring>sstring in gforth, but not the        other way sstring>cstring?       - Please raise any other detail, I did wrong! ;)              best regards & many thanks for any hints in advance - okflo              #+begin_src forth        \ http-request bindings to libcurl for gforth (>= 0.7.9)               c-library curl        s" curl-gnutls" add-lib        \c #include |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca