1

This is my operation contract. I want to test this method in a browser. But when I type any email in the browser like http://localhost:1234/json/user/abc/abc@abc.com, it does not work

[OperationContract]
[WebInvoke(Method = "GET", 
 RequestFormat = WebMessageFormat.Json,
 ResponseFormat = WebMessageFormat.Json, 
 BodyStyle = WebMessageBodyStyle.Wrapped, 
 UriTemplate = "json/user/{name}/{email}")]
string addUser(string name, string email);

How do I send the email address as a single string?? any idea?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Reza.Hoque
  • 2,690
  • 10
  • 49
  • 78

1 Answers1

1

Try to URL encode your e-mail address:

http://localhost:1234/json/user/abc/abc%40abc.com

Does that result in the call you expect?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • HTTP 404. The resource you are looking for or one of its dependencies, may have been removed or is temporarily unavailable. Check the following URL is spelled correctly. – Reza.Hoque Aug 17 '11 at 14:04
  • what about the (.). do I have to do anything for that? – Reza.Hoque Aug 17 '11 at 14:04
  • check this question: http://stackoverflow.com/questions/3541426/how-to-get-asp-net-mvc-to-match-dot-character-at-the-end-in-a-route – Daniil Novikov Aug 17 '11 at 14:23