Could you post the code for the valuescontroller?
Asp.net Core 2.1 web api deployed successfully but not getting response from my web api url
Can you please guide me why i am not getting response from following link
https://otgapi.azurewebsites.net/api/values
This url shows https://otgapi.azurewebsites.net/ api deployed successfully.
3 answers
Sort by: Most helpful
-
-
A b d u l Wahab 1 Reputation point
2020-06-17T11:48:19.33+00:00 using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using OTG.BusinessService;namespace OTGWebAPI.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class ValuesController : Controller
{
private IAuthService _authService;public ValuesController(IAuthService authService) { _authService = authService; } // GET api/values [HttpGet] public IEnumerable<string> Get() { return new string[] { "value1", "value2" }; } // GET api/values/5 [HttpGet("{id}")] public string Get(int id) { return "value"; } // POST api/values [HttpPost] public void Post([FromBody] string value) { } // PUT api/values/5 [HttpPut("{id}")] public void Put(int id, [FromBody] string value) { } // DELETE api/values/5 [HttpDelete("{id}")] public void Delete(int id) { } }
}
-
Monalla-MSFT 13,031 Reputation points
2020-06-25T03:27:41.12+00:00 Hello @A b d u l Wahab ,
Thanks for reaching out to us.
If I understand your problem correctly, you are having issues deploying your web app to Azure App Service. Correct?
If that is the case, Can you elaborate how you are trying to deploy the code ?
Follow the below documents which will guide you through the deployment process if you haven't followed earlier .
I hope this information helps. Please feel free to reach back out for any further questions or clarifications.