Re: Need help with delegates and vibed

2016-03-20 Thread Suliman via Digitalmars-d-learn
The constructor for HTTPClientRequest is likely undocumented because you should not construct it yourself; vibe.d constructs it and passes it to the function you register with listenHTTP. How to understand looking at docs that it work as you saying?

Need help with delegates and vibed

2016-03-20 Thread Suliman via Digitalmars-d-learn
I can't understand how to get works delegates works from this doc http://vibed.org/api/vibe.http.client/requestHTTP I see example, but when I am looking on Prototypes I really can't figure how to use them. For example what does this mean: scope void delegate(scope HTTPClientRequest) requeste

Re: Need help with delegates and vibed

2016-03-19 Thread Mathias Lang via Digitalmars-d-learn
On Wednesday, 16 March 2016 at 20:08:40 UTC, Suliman wrote: I can't understand how to get works delegates works from this doc http://vibed.org/api/vibe.http.client/requestHTTP I see example, but when I am looking on Prototypes I really can't figure how to use them. For example what does this

Re: Need help with delegates and vibed

2016-03-19 Thread Alex Parrill via Digitalmars-d-learn
On Saturday, 19 March 2016 at 19:53:01 UTC, Suliman wrote: Thanks! I am understand a little bit better, but not all. ``` shared static this() { auto settings = new HTTPServerSettings; settings.port = 8080; listenHTTP(settings, &handleRequest); } void handleRequest(HTTPS

Re: Need help with delegates and vibed

2016-03-19 Thread Suliman via Digitalmars-d-learn
Thanks! I am understand a little bit better, but not all. ``` shared static this() { auto settings = new HTTPServerSettings; settings.port = 8080; listenHTTP(settings, &handleRequest); } void handleRequest(HTTPServerRequest req, HTTPServerResponse res)