How can I get Uri
or HttpWebRequest
to allow uri containing both /
and %2f
as shown below?
http://localhost:55672/api/exchanges/%2f/MyExchange
I tried this ...
WebRequest request = HttpWebRequest.Create("http://localhost:55672/api/exchanges/%2f/MyExchange");
... and this...
Uri uri = new Uri("http://localhost:55672/api/exchanges/%2f/MyExchange", true); WebRequest request = HttpWebRequest.Create(uri);
... and this...
UriBuilder builder = new UriBuilder(); builder.Port = 55672; builder.Path = "api/exchanges/%2f/MyExchange"; WebRequest request = HttpWebRequest.Create(builder.Uri);
However, with all these parameters, request.RequestUri
ends with http://localhost:55672/api/exchanges///MyExchange
, and request.GetResponse()
http://localhost:55672/api/exchanges///MyExchange
404 response.
FYI I'm trying to use the RabbitMQ HTTP API, and typing Url in Chrome gives the expected JSON result.
source share