 Sends the given data as content to the client
 
 */
-public class HTTPResponse : StreamWritable
+public class HTTPResponse : StreamWritable, StreamReadable
 {
+	public let version:String
+	public let status:String
+	public var header:[String:String]
+	
 	public let content:NSData
-	public let mimeType:String
+	
+	required public init(byReadingFrom stream: InputStream) throws
+	{
+		content = NSData()
+		version = "HTTP/1.1"
+		status = "200 OK"
+		header = [:]
+	}
 	
 	public init(with content: String)
 	{
 		self.content = content.dataUsingEncoding(NSUTF8StringEncoding)!
-		self.mimeType = "text/html"
+		version = "HTTP/1.1"
+		status = "200 OK"
+		header = [:]
 	}
 	
-	public init(with content: NSData, mimeType: String)
+	public init(with content: NSData)
 	{
 		self.content = content
-		self.mimeType = mimeType
+		version = "HTTP/1.1"
+		status = "200 OK"
+		header = [:]
 	}
 	
 	public func write(to outputStream: OutputStream) throws
 	{
 		try outputStream.writeln("HTTP/1.1 200 OK")
-		try outputStream.writeln("Date: \(DateFormatter.stringFromDate(NSDate()))")
+		try outputStream.writeln("Date: \(HTTPDateFormatter.stringFromDate(NSDate()))")
 		try outputStream.writeln("Server: PK-SocketKit/0.1a (OS X/Swift)")
-		try outputStream.writeln("Last-Modified: \(DateFormatter.stringFromDate(NSDate()))")
+		try outputStream.writeln("Last-Modified: \(HTTPDateFormatter.stringFromDate(NSDate()))")
 		try outputStream.writeln("Accept-Ranges: bytes")
 		try outputStream.writeln("Connection: close")
-		try outputStream.writeln("Content-Type: \(mimeType)")
+		try outputStream.writeln("Content-Type: text/html")
 		try outputStream.writeln("Content-Length: \(content.length)")
 		try outputStream.writeln()
 		try outputStream.write(content)

}


public struct HTTPRequest : StreamReadable, StreamWritable
{
	public init(byReadingFrom stream: InputStream) throws


/**

Date formatter for HTTP time format

*/
internal let HTTPDateFormatter:NSDateFormatter =
{
	let formatter = NSDateFormatter()
	formatter.dateFormat = "EEE, d MMM yyyy HH:mm:ss zzz"
