views:

204

answers:

1

HI How do u pass a '/' as a paramter in a wcf service rest way. e.g if the user name has the domain includes "domain/userName"

thanks

+1  A: 

The escape string for / is %2F. If you're asking how to do this programatically, the use Uri::EscapeDataString.

Drew Marsh
using %2F gives a bad request message from server
I'm afraid you're not giving enough details to really be able to help. Are you passing data on the querystring or in the path? What client stack are you using to make the call? Are you just building strings by hand and using HttpWebRequest or WebClient to make the call to the service or are you using a WCF Client?
Drew Marsh
the data is being passed in the path. The method is being used to get the user details. The user id being passed also has the domain in ithttp://Service.svc/User/domain\useridi am using httpClient to get the response
Well, you said '/' and you're putting '\'. '\' is encoded as %5C. Again, if you use the Uri class to build your Uris or, at the very least, use Uri::Escape[Uri|Data]String when building strings by hand, you don't need to worry about about these things.
Drew Marsh
I tried using the Uri.EscapeDataString but got a method not implemented response from the server
Any stack trace/exception info you can post would be extremely useful. Are you doing a POST or a GET against this Uri?
Drew Marsh