의미가 있습니다. 이것은 당신에게 같은 출력을 줄 것이다
Get["/test"] = _ =>
{
var responseThing = new
{
this.Request.Headers,
this.Request.Query,
this.Request.Form,
this.Request.Session,
this.Request.Method,
this.Request.Url,
this.Request.Path
};
return Response.AsJson(responseThing);
};
:
{
"Form":{
},
"Headers":[
{
"Key":"Cache-Control",
"Value":[
"max-age=0"
]
},
{
"Key":"Connection",
"Value":[
"keep-alive"
]
},
{
"Key":"Accept",
"Value":[
"text/html;q=1",
"application/xhtml+xml;q=1",
"application/xml;q=0.9",
"*/*;q=0.8"
]
},
{
"Key":"Accept-Encoding",
"Value":[
"gzip,deflate,sdch"
]
},
{
"Key":"Accept-Language",
"Value":[
"en-US,en;q=0.8"
]
},
{
"Key":"Host",
"Value":[
"localhost:2234"
]
},
{
"Key":"User-Agent",
"Value":[
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.29 Safari/537.36"
]
}
],
"Method":"GET",
"Path":"/test",
"Query":{
"23423":"fweew"
},
"Session":[
],
"Url":{
"BasePath":null,
"Fragment":"",
"HostName":"localhost:2234",
"IsSecure":false,
"Path":"/test",
"Port":null,
"Query":"23423=fweew",
"Scheme":"http",
"SiteBase":"http://localhost:2234"
}
}
여기 위키
https://github.com/NancyFx/Nancy/wiki/Hosting-nancy-with-owin#accessing-owin-environment-variables
에 설명 된대로 내가 일부가 발굴했을 때 당신은 또한 Owin 환경 변수를 얻을 수 있습니다 내 자신의 디버거를 사용하여 Sinatra에 표시되지 않은 서버 프로토콜과 같은 몇 가지 항목이있었습니다. 그래서 나는 단지 내가 뭔가를 놓치지 않고 있는지 확인하고 싶다. 어쩌면 이것이 두 프레임 워크의 차이 일 수도 있지만, 적어도 내가 추측하기 전에 반드시 확인해야한다고 생각했습니다. – Wade73
충분히 공정하고, 내가 그 모든 정보를 필요로한다고 말할 수 없다 :) 나는 Theres에 Owin 환경 변수에 대해서도 언급하는 것을 잊었다. – Phill
사실 Sinatra에서 수행중인 작업을 재현하는 것은 운동 일 뿐이므로 실제로 그렇게 중요하지 않습니다. 감사. – Wade73