Пример #1
0
 /// <summary>
 ///     Returns dictionary from Request POST data
 ///     Please note the underlying input stream is not rewindable.
 /// </summary>
 /// <param name="context">The context to request body as string.</param>
 /// <returns>A collection that represents KVPs from request data.</returns>
 public static Dictionary <string, object> RequestFormDataDictionary(this HttpListenerContext context)
 {
     return(RequestFormDataDictionary(context.RequestBody()));
 }
Пример #2
0
 /// <summary>
 ///     Parses the JSON as a given type from the request body.
 ///     Please note the underlying input stream is not rewindable.
 /// </summary>
 /// <typeparam name="T">The type of specified object type.</typeparam>
 /// <param name="context">The context.</param>
 /// <returns>
 ///     Parses the json as a given type from the request body.
 /// </returns>
 public static T ParseJson <T>(this HttpListenerContext context) where T : class
 {
     return(ParseJson <T>(context.RequestBody()));
 }