如何在wcf方法中将电子邮件地址作为参数发送 [英] How to send email address as parameter in wcf method

查看:20
本文介绍了如何在wcf方法中将电子邮件地址作为参数发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的运营合同.我想在浏览器中测试这个方法.但是当我在浏览器中输入任何电子邮件时,例如 http://localhost:1234/json/user/abc/abc@abc.com,它不起作用

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?

推荐答案

尝试对您的电子邮件地址进行 URL 编码:

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?

这篇关于如何在wcf方法中将电子邮件地址作为参数发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆