Пример #1
0
 public static void WriteEmptyResponse(this HttpMessageWriter writer, StatusCodes statusCode)
 {
     writer.WriteStatusLine(statusCode);
     writer.WriteAuxiliaryHeaders();
     writer.WriteContentLength(0);
     writer.WriteCRLF();
 }
Пример #2
0
 public static void WriteOptionsResponse(this HttpMessageWriter writer)
 {
     writer.WriteStatusLine(StatusCodes.OK);
     writer.WriteAuxiliaryHeaders();
     writer.WriteAllow(Methods.Get, Methods.Options);
     writer.WriteContentLength(0);
     writer.WriteCRLF();
 }
Пример #3
0
 public static void WriteResponse(this HttpMessageWriter writer, StatusCodes statusCodes, ContentType contentType, byte[] content)
 {
     writer.WriteStatusLine(statusCodes);
     writer.WriteAuxiliaryHeaders();
     writer.WriteContentType(contentType);
     writer.WriteContentLength(content.Length);
     writer.WriteCRLF();
     writer.Write(content);
 }
Пример #4
0
 public static void WriteNotFinishedResponse(this HttpMessageWriter writer, StatusCodes statusCode, ContentType contentType)
 {
     writer.WriteStatusLine(statusCode);
     writer.WriteAuxiliaryHeaders();
     if (contentType != ContentType.None)
     {
         writer.WriteContentType(contentType);
     }
     else
     {
         writer.WriteContentLength(0);
     }
 }