anchor.diff:      sb.write("  ${value.toString()}\n");
     });
     sb.write('''request.headers.expires : ${request.headers.expires}
  -request.headers :
  -  ''');
  -  var str = request.headers.toString();
  -  for (int i = 0; i < str.length; i++){
  -    if (str[i] == "\n") { sb.write("\n  ");
  -    } else { sb.write(str[i]);
  -    }
  -  }
  -  sb.write('''
  +request.headers :''');
  +  request.headers.forEach((name,values){
  +    sb.write('\n  $name :');
  +    values.forEach((value) {
  +      sb.write(' $value');
  +    });
  +  });
  +  sb.write('''\n
   request.session.id : ${request.session.id}
   requset.session.isNew : ${request.session.isNew}
   ''');
     if (request.method == "POST") {
  -    var enctype = request.headers["content-type"];
  -    if (enctype[0].contains("text")) {
  -      sb.write("request body string : ${bodyString.replaceAll('+', ' ')}");
  -    } else if (enctype[0].contains("urlencoded")) {
  -      sb.write("request body string (URL decoded): ${urlDecode(bodyString)}");
  +    var enctype = request.headers["content-type"][0];
  +    if (enctype.contains("text")) { // UTF8 encoded text/plain
  +      sb.write("request body string (text/plain) : ${UTF8.decode(bodyBytes)}");
  +    } else if (enctype.contains("urlencoded")) { // URL encoded
  +      sb.write("request body string (URL decoded): "
  +        + Uri.decodeQueryComponent(UTF8.decode(bodyBytes)));
       }
     }
     sb.write("\n");
  
positive.code: }
  
  // create log message
  StringBuffer createLogMessage(HttpRequest request, [String bodyString]) {
    var sb = new StringBuffer( '''request.headers.host : ${request.headers.host}
  request.headers.port : ${request.headers.port}
  request.connectionInfo.localPort : ${request.connectionInfo.localPort}
  
negative.code:   Aug. 2013, API change (removed StringDecoder and added dart:convert) fixed
    Oct. 2013, API change (dart:utf removed) fixed
    Nov. 2013, API change (remotHost -> remoteAddress) fixed
    Aug. 2015, Updated for the latest API
  */
  
  import "dart:async";
  