November 28, 2015
On Saturday, 28 November 2015 at 19:10:17 UTC, Suliman wrote:
> void action(HTTPServerRequest req, HTTPServerResponse res)
> {
>
> }
>
> Here is function what have two call-backs. When it's get request it's work as server, when it's send response it's work like client or I have wrong logic?

Wrong logic. Its the server that gets the request and the server that send the response.
November 29, 2015
On Saturday, 28 November 2015 at 23:21:21 UTC, Sebastiaan Koppe wrote:
> On Saturday, 28 November 2015 at 19:05:59 UTC, Suliman wrote:
>> And also I can't understand difference between HTTPClientRequest and HTTPServerRequest
>
> If the application (vibe.d) makes a request, it is the client. If the request is made to your application, it is the server.
>
> In your case your angular app is the client, and your vibe.d app is the server. Therefor, HTTPServer(Request|Response).

Could you explain me about: HTTPServerRequest and HTTPRequest. I can't understand difference.
November 30, 2015
On Sunday, 29 November 2015 at 07:37:56 UTC, Suliman wrote:
> On Saturday, 28 November 2015 at 23:21:21 UTC, Sebastiaan Koppe wrote:
>> On Saturday, 28 November 2015 at 19:05:59 UTC, Suliman wrote:
>>> And also I can't understand difference between HTTPClientRequest and HTTPServerRequest
>>
>> If the application (vibe.d) makes a request, it is the client. If the request is made to your application, it is the server.
>>
>> In your case your angular app is the client, and your vibe.d app is the server. Therefor, HTTPServer(Request|Response).
>
> Could you explain me about: HTTPServerRequest and HTTPRequest. I can't understand difference.

No idea. Probably HTTPRequest provides common functionality for both HTTPServerRequest and HTTPClientRequest. Just guessing.
December 02, 2015
On Saturday, 28 November 2015 at 18:03:13 UTC, Suliman wrote:
> Could anybody help me to understand how to complete HTTP response with vibed.
>
> I am sending POST request from AngularJS:
>
> $.post("http://127.0.0.1:8080/my", total_result);
> where total_result is JSON string: [{"QID":3,"AID":3}, {"SubAID":[4]}, {"MinArea":"10","MaxArea":"90"}]
>
> Handler is look like:
>
> void action(HTTPServerRequest req, HTTPServerResponse res)
> {
>    // res.statusCode = 201;
> }
>
> I know that I can set statusCode like code above, but problem that in Chrome console I am getting:
> POST http://127.0.0.1:8080/my 404 (Not Found)
> How can I pass to it (from vibed to browser) status code?
If you do not send any response in handler, vibe.d will try to match next route (if any). So you should send any response (empty string for example).

void action(HTTPServerRequest req, HTTPServerResponse res)
{
    res.statusCode = 201;
    res.writeBody("");
}

1 2
Next ›   Last »