Hey this is something I was creating the other week. It's a http client more 
like the fetch library. It is both async and sync by using the multi sync 
macro. Also have patched sockets to accept unix socket addresses.

the body() returns either as a proc or iterator. The iterator is essentially is 
the chunks sent from the server. You can also use streams to if you don't want 
to work with the iterator.

It needs some work and I had a dog ate my homework situation and lost 2 days of 
dev because "git push ." was returning "repo already sync'd and up to date" but 
it wasn't and my drive was wiped

I'm trying to keep the api simple. Theres a todo on the repo if you want to 
contribute :)
    
    
    let client: HttpClient
      let resp = client.fetch(HttpGet, "https://httpbin.org/get";)
      
      case resp.httpCode:
      of Http200:
        # data iterator
        for data in resp.body():
            echo data
    
    
    Run

<https://github.com/lantos-lgtm/nim-http>

Reply via email to