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();
            }
        }
Exemple #2
0
 public void Post(string host, string path, string json, Action <string, FizzException> callback)
 {
     if (OnPost != null)
     {
         OnPost.Invoke(host, path, json);
     }
 }
Exemple #3
0
 protected virtual void OnPostAction(PostEventArgs <string> e)
 {
     OnPost?.Invoke(this, e);
 }
Exemple #4
0
 void Post(string path, System.Collections.Specialized.NameValueCollection query)
 {
     OnPost?.Invoke(path, query);
 }
Exemple #5
0
 protected void OnPostAction(PostEventArgs <Dictionary <string, object> > e)
 {
     OnPost?.Invoke(this, e);
 }
Exemple #6
0
 protected virtual void OnPostAction(PostEventArgs <ObjectType> e)
 {
     OnPost?.Invoke(this, e);
 }