I am wondering what's the difference between HttpContext.Request.Path and HttpContext.Request.PathBase in a Web API controller? I read the documentation but didn't understand what the intented difference should be, even after testing both properties:
public async Task<ActionResult<string>> PostItem(ItemPostRequest itemPostRequest)
{
// Output: Path is: '/api/items'
Debug.WriteLine($"Path is: '{HttpContext.Request.Path}'");
// Output: PathBase is: ''
Debug.WriteLine($"PathBase is: '{HttpContext.Request.PathBase}'");
// [...]
}
When would PathBase be non-empty? I am on NET 5.0.