NancyFX: Routes with query string parameters always returns a 404 NotFound


I hv a easy Nancy module. i require to pass in query string (q-s) parameters to the handler. If I don't have any q-s params everything is good. As soon as I add a param then I get a 404 status code snippet returned.
NancyModule
public class SimpleModule : NancyModule
{
public SimpleModule()
{
Get"/" = parameters => HttpStatusCode.OK;
}
}

Unit test - Passes
Fact
public void SimpleModule__Should_return_statusOK_when_passing_query_params()
{
const string uri = "/";
var output = Fake.Browser().Get(uri with => with.HttpRequest());
output.StatusCode.ShouldBe(HttpStatusCode.OK);
}

Unit test - Fails
Fact
public void SimpleModule__Should_return_statusOK_when_passing_query_params()
{
const string uri = "/?id=1";
var output = Fake.Browser().Get(uri with => with.HttpRequest());
output.StatusCode.ShouldBe(HttpStatusCode.OK);
}

Thanks



Get Source Code

  Views 148   Posted on : Thursday, March 21, 2013 10:41:57 AM
Related Tags:




Replies on "NancyFX: Routes with query string parameters always returns a 404 NotFound" :

Nobody has replied on this post , be first to post answer.


Post Your Answer/Comment:

Please Login first to post Reply !


Note: Please Put Code into <code></code> block.




Also See: