【发布时间】:2020-01-13 03:35:17
【问题描述】:
我需要将 HTML 字符串发送到服务器。 我正在使用 Swift alamofire,当我尝试调用 Rest api 然后从服务器获取 ccs 代码响应。 与 PostMan 中使用的正文格式相同,并且运行良好。
我的请求体参数:
{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";}
回复:
无效的 json 格式。获取 CSS 代码。 参数值为
"<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."
【问题讨论】:
-
"我的请求正文参数:"你能展示一些关于你是如何得到它的代码吗?另外,为什么它看起来像是
NSDictionary而不是 Swift 字典?
标签: ios json swift swift3 swift4