private void handleRequest(HttpListenerContext context) { var eventArgs = new HttpEventArgs(context.Request, context.Response); var method = context.Request.HttpMethod; try { if (method == HttpMethod.Get.Method) { OnGet?.Invoke(this, eventArgs); } else if (method == HttpMethod.Post.Method) { OnPost?.Invoke(this, eventArgs); } else if (method == HttpMethod.Put.Method) { OnPut?.Invoke(this, eventArgs); } } catch (NotImplementedException) { context.Response.Abort(); } }
public void Post(string host, string path, string json, Action <string, FizzException> callback) { if (OnPost != null) { OnPost.Invoke(host, path, json); } }
protected virtual void OnPostAction(PostEventArgs <string> e) { OnPost?.Invoke(this, e); }
void Post(string path, System.Collections.Specialized.NameValueCollection query) { OnPost?.Invoke(path, query); }
protected void OnPostAction(PostEventArgs <Dictionary <string, object> > e) { OnPost?.Invoke(this, e); }
protected virtual void OnPostAction(PostEventArgs <ObjectType> e) { OnPost?.Invoke(this, e); }