Question

I'm using a UriTemplate wildcard to match the whole URI string after the path to a WCF svc:

    [WebGet(
        UriTemplate = "feed/{*path}" 
        )]

However this only matches up until the first space (or '+' or '%20'), is it possible to get it to match spaces?

This works: /feed.svc/Folder

These don't work (only returns up to the first space)

/feed.svc/Folder Name

/feed.svc/Folder+Name

/feed.svc/Folder%20Name

Cheers

Was it helpful?

Solution

OK the culprit was the IIS rewrite rules I had in place:

^([0-9a-zA-Z\-\.\/()]+) 

This was not matching spaces so I just had to add the space character to the regex, ala:

^([ 0-9a-zA-Z\-\.\/()]+)

Tada!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top