src/Foundation/Net/Gimela.Net.Http/Messages/ResponseWriter.cs
/// <summary>
/// Converts and sends a string.
/// </summary>
/// <param name="context"></param>
/// <param name="data"></param>
/// <param name="encoding">Encoding used to transfer string</param>
Converts and sends a string.
Converts and sends a string .
public void Send(IHttpContext context, string data, Encoding encoding)
    {
      try
      {
        byte[] buffer = encoding.GetBytes(data);
        Logger.Debug("Sending " + buffer.Length + " bytes.");
        if (data.Length < 4000)
          Logger.Trace(data);
        context.Stream.Write(buffer, 0, buffer.Length);
      }
      catch (Exception err)
      {
        Logger.Error("Failed to send data through context stream.");
        ExceptionHandler.Handle(err);
      }
    }
public void Send ( IHttpContext context , string data , Encoding encoding ) { try { byte [ ] buffer = encoding . GetBytes ( data ) ; Logger . Debug ( " " + buffer . Length + " " ) ; if ( data . Length < 4000 ) Logger . Trace ( data ) ; context . Stream . Write ( buffer , 0 , buffer . Length ) ; } catch ( Exception err ) { Logger . Error ( " " ) ; ExceptionHandler . Handle ( err ) ; } }
Converts and sends a string.
Converts and sends a string .
context
IHttpContext
None
data
string
None
encoding
Encoding
Encoding used to transfer string
Encoding used to transfer string