Fix due to the modified HttpServer.cs
This commit is contained in:
Binary file not shown.
@@ -16,9 +16,9 @@ namespace Example3
|
||||
{
|
||||
_httpsv = new HttpServer<Echo>(4649);
|
||||
|
||||
_httpsv.OnResponse += (sender, e) =>
|
||||
_httpsv.OnGet += (sender, e) =>
|
||||
{
|
||||
onResponse(e.Context);
|
||||
onGet(e.Request, e.Response);
|
||||
};
|
||||
|
||||
_httpsv.OnError += (sender, e) =>
|
||||
@@ -54,19 +54,5 @@ namespace Example3
|
||||
|
||||
response.StatusCode = (int)HttpStatusCode.NotFound;
|
||||
}
|
||||
|
||||
private static void onResponse(HttpListenerContext context)
|
||||
{
|
||||
var req = context.Request;
|
||||
var res = context.Response;
|
||||
|
||||
if (req.HttpMethod == "GET")
|
||||
{
|
||||
onGet(req, res);
|
||||
return;
|
||||
}
|
||||
|
||||
res.StatusCode = (int)HttpStatusCode.MethodNotAllowed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user