I'm getting a 404 Not Found
when making this call:
var url = rootWebApiUrl + '/folders/' + $scope.selectedServer.Name + "/" + serviceName;
$http.get(url) // the rest of this line doesn't matter for this issue
I thought that maybe using encodeURIComponent
would help, but I get the same 404 Not Found
error:
var url = rootWebApiUrl + '/folders/' + $scope.selectedServer.Name + "/" + encodeURIComponent(serviceName);
This is the Web API Method Signature:
[Route("folders/{serverName}/{serviceName}")]
[HttpGet]
public IEnumerable<Folder> Folders(string serverName, string serviceName)
The first option (above) works if I change the service name while debugging. The original service name is Company Name Message Bus Manager 3.6 - MesFinishingEvents
. If I change it to something with no spaces, like snuh
, then the Web API call succeeds and I can debug in the Web API method.
How can I pass the original service name in my $http.get(url)
call?
Edit: URL values:
With service name that has spaces:
http://localhost:4153/api/services/folders/ServerName/Company%20Name%20Message%20Bus%20Manager%203.6%20-%20MesFinishingEvents
Using a simple service name:
http://localhost:4153/api/services/folders/ServerName/snuh