In IResponseProcessor.Process
string format = context.Request.Query["format"].Value ?? "json";
format = format.ToLower();
Response response;
switch (format)
{
case "protbuf":
response = // balabalabala
break;
case "yaml":
response = // balabalabala
break;
case "xml":
response = // balabalabala
break;
case "jsonp":
response = // balabalabala
break;
case "json":
default:
response = new JsonResponse(apiResponse, new DefaultJsonSerializer());
break;
}
if (context.Response != null)
{
// for test
context.Response.Cookies.Add(new NancyCookie("wener", "cool"));
//response.Cookies.InjectFrom(context.Response.Cookies);
//response.Headers.InjectFrom(context.Response.Headers);
}
return response;
ValueInjecter can not deal with List,because the NancyCookie dose not hava parameter-less ctor,I can not use this neither.
It is possible to copy cookie and header without foreach ? and how ?