Click here to Skip to main content
15,846,976 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to return json value using
IHttpActionResult and CreatedAtRoute

but
The resource cannot be found
error occuer

What I have tried:

<pre> // GET: Test
        object json;
        public IHttpActionResult Index()
        {
            json = new
            {
                Name = "hi"
            };
            return CreatedAtRoute("DefaultApi", new { id = 1 }, json);
        }
Posted
Comments
Richard MacCutchan 11-Nov-18 9:11am    
What resource? What language is this supposed to be?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900