This hits the corresponding method:
https://localhost:44379/annotation/getbytarget/https%3a%2f%2f
whereas this one causes 404:
https://localhost:44379/annotation/getbytarget/https%3a%2f%2fa
The only difference between the two URLs is that the latter has one extra letter (a) at the end. I am calling these URLs from the browser. But firstly, I had tried HttpClient's GetStringAsync method. No difference.
My goal is to call this URL:
https://localhost:44379/annotation/getbytarget/https://analyzer.app/analysis/60be725a980f947a351e2e97
I am encoding this URL so it becomes:
https://localhost:44379/annotation/getbytarget/https%3a%2f%2fanalyzer.app%2fanalysis%2f60be725a980f947a351e2e97
What could be the reason for this error?
This is an ASP.NET Core 3.1 Web API application and the corresponding Web API method is as follows:
[HttpGet("{id}")]
public ActionResult<List<Annotation>> GetByTarget(string id)
{
var annotations = _annotationService.GetByTarget(id);
if (annotations == null)
{
return NotFound();
}
return annotations;
}