Click here to Skip to main content
15,899,937 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Deployed a sample(out of the template while we create WebAPI) on Win Server 2012
 [Route("api/[controller]")]
    [ApiController]
    public class ValuesController : ControllerBase
    {
        // GET api/values
        [HttpGet]
        public ActionResult<IEnumerable<string>> Get()
        {
            return new string[] { "value1", "value2" };
        }
<pre>[HttpPost]
        [Route("post")]
        public async Task<string> post()
        {
            using (StreamReader reader = new StreamReader(Request.Body, Encoding.UTF8))
            {
                string input = await reader.ReadToEndAsync();
                Number_2Text objConvert = new Number_2Text();
                string result = objConvert.ConvertText(input);
                return result;
            }
        }



What I have tried:

Jsut an add class converting 12 to say twelve like so;


https://IP Address/VirtualDirectoryName/api/values

Not getting POST and Get calls
Is there any specific settings which has to be done while Server machine?

Tried:
1)>Net managed App Pool
2)dotnet MyCOde.dll run
Posted

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