Ios 如何使用Swift Alamofire在REST API中发送HTML标记字符串?
我需要发送HTML字符串到服务器。 我正在使用Swift-alamofire,当我尝试调用restapi,然后从服务器获得ccs代码响应时。 和《邮递员》中使用的身体格式一样,效果很好 我的请求正文参数:Ios 如何使用Swift Alamofire在REST API中发送HTML标记字符串?,ios,json,swift,swift3,swift4,Ios,Json,Swift,Swift3,Swift4,我需要发送HTML字符串到服务器。 我正在使用Swift-alamofire,当我尝试调用restapi,然后从服务器获得ccs代码响应时。 和《邮递员》中使用的身体格式一样,效果很好 我的请求正文参数: {body = "<br/><br/>Hi Bhavdip,<br/><br/>Please find the One-Time Password (OTP) as requested through application.<br/>
{body = "<br/><br/>Hi Bhavdip,<br/><br/>Please find the One-Time Password (OTP) as requested through application.<br/>OTP- 123456 <br/><br/>Kindly, enter this OTP in your mobile application to authenticate your account and change phone number.<br/><br/>Kind regard,<br/>VeriDoc Global Team.";subject = "VeriDoc Global OTP for Account Verification";toaddress = "bambhroliya.bhavdip@example.com"; toname = "Bhavdip Patel";}
{body=“
Hi Bhavdip,
请根据应用程序的要求查找一次性密码(OTP)。
OTP-123456
请在您的移动应用程序中输入此OTP,以验证您的帐户并更改电话号码。
“用于帐户验证的VeriDoc全局OTP”;toaddress=“bambhroliya。bhavdip@example.com“toname=“Bhavdip Patel”}
答复:
json格式无效。正在获取css代码。
参数值为
“
您好,Bhavdip,
请根据应用程序的要求查找一次性密码(OTP)。
OTP-123456
请在您的移动应用程序中输入此OTP,以验证您的帐户并更改电话号码。
让params=[body=“
你好,Bhavdip,
请通过应用程序查找一次性密码(OTP)。
OTP-798580
请在您的移动应用程序中输入此OTP,以验证您的帐户并更改电话号码。
用于账户验证的VeriDoc全球OTP”,toaddress=“bambhroliya。bhavdip@tristonsoft.com,toname=“Bhavdip Patel”]as![字符串:任意]
将其用作参数“我的请求正文参数:”你能展示一些你是如何得到它的代码吗?还有,为什么它看起来像是一个NSDictionary
,而不是一个Swift字典?
"<br/><br/>Hi Bhavdip,<br/><br/>Please find the One-Time Password (OTP) as requested through application.<br/>OTP- 123456 <br/><br/>Kindly, enter this OTP in your mobile application to authenticate your account and change phone number.<br/><br/>Kind regard,<br/>VeriDoc Global Team."