Get REST Call is not returning the string I put in url
- by wizage
I have very simple code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace Calculator.Controllers
{
public class CalcController : ApiController
{
public string Get(string type)
{
return type;
}
}
}
And this is what it returns when I type in http://www.example.com/api/calc/test
<string xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2003/10/Serialization/" i:nil="true"/>
When I use http://www.example.com/api/calc/?test=test it returns this:
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">type</string>
How to I make it so I can just do the top one instead of the bottom one?