3

I have an Asp.Net Web Api application which takes ip address as input and return the country of that respective ip. when I pass the below url

http://localhost:portno/xx.xx.xx.xx

it throws Error 404

can any one tell me why?

wazza
  • 770
  • 5
  • 17
  • 42

1 Answers1

6

Short hacky answer: Add a trailing forward slash. IIS thinks it's a file at the end of hte URL.

Longer, more elegant answer: Check out these links for cleaner fixes that require more work:

ApiController returns 404 when ID contains period

Dots in URL causes 404 with ASP.NET mvc and IIS

Community
  • 1
  • 1
The Cline
  • 171
  • 3
  • 9