0

I am working on a program to GET data from an API.

I am having an issue with error 404, which I resolved by setting the Web Property on the Web application to the name of the controller(rating), and the name of the method (index.)

enter image description here

Is this best way to deal with 404?

Also,

I need to pass these property values into the URL, how do I do this working alongside the above fix?

enter image description here

Thank you

  • 1. What are you doing to get a 404 and what does your controller action look like? Setting "specific page" as startup page doesn't really solve anything. 2. Don't post code as an image. – Xerillio Feb 10 '21 at 21:23
  • My controller class is RatingController. I fixed the specific page startup by changing the Map Route to defaults: new { controller = "Rating", action = "Index", id = UrlParameter.Optional } from defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } however, I now need to pass in the ID to the URL – Brandon Parkinson Feb 10 '21 at 21:35

1 Answers1

0

Look like you in debug mode on the web app. Thats why setting the specific start page to rating/index solve your 404. For debugging API app this is fine. To have another app GET data from this API app you need to invoke the API app this way:

<URL of the API app>/rating/index

e.g.

https://myAPIapp.com/rating/index