jdoig
jdoig

Reputation: 1492

Open Rasta InMemoryHost returning 406 error

I'm trying to write an integration test for an open rasta web service (code bellow)

using(var host = new InMemoryHost(new Configuration()))
{
    var request = new InMemoryRequest {Uri = new Uri("http://localhost/foo"), HttpMethod = "GET"};
    request.Entity.Headers["Accept"] = "application/json";

    var response = host.ProcessRequest(request);
}

But keep getting a 406 response.

If I don't specify the json accept header I get a 500 error.

Upvotes: 1

Views: 405

Answers (1)

JPReddy
JPReddy

Reputation: 65543

I recently come across this 406 problem. But in my case I could found the problem root cause and then there is a known issue in the Openrasta which is why I was getting 406.

Here is the link for the discussion I had on google group. May be if you dig into the debug information, you will find the route cause of it.

I'm posting this answer thinking that it might be useful for other users who come across same situation.

Upvotes: 2

Related Questions