Alright, So I tried to create a simple AsyncHttpClient, but I was unable to 
figure out how to use it... This is as far as I got: 
    
    
    import httpclient, asyncdispatch, os
    proc main() {.async.} =
      var client = newAsyncHttpClient()
      echo("HERE!")
      var resp = await client.request("https://ca.yahoo.com/?p=us";)
      echo("THERE!")
      #writeFile("test.html", resp.body)
      client.close()
    var doneTest: bool = false
    proc newWaitFor*[T](fut: Future[T]): T =
      if (fut.finished == false):
        echo("Before poll")
        poll()
        echo("After poll")
      else:
        doneTest = true
        echo "done!"
        fut.read
    var i = 0
    while doneTest == false:
      i += 1
      #echo (i)
      if i >= 40:
        newWaitFor(main())
    

It never actually completes for some reason...

Reply via email to