Get REST Call is not returning the string I put in url

christierae1989

New Member
I have very simple code:\[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; } }}\[/code\]And this is what it returns when I type in http://www.example.com/api/calc/test\[code\]<string xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2003/10/Serialization/" i:nil="true"/>\[/code\]When I use http://www.example.com/api/calc/?type=test it returns this:\[code\]<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">test</string>\[/code\]How to I make it so I can just do the top one instead of the bottom one?
 
Back
Top