duanpasi6287 2015-12-14 10:27 采纳率: 100%
浏览 19
已采纳

发送在帖子中编码的特殊字符是否正常

I had a discussion with someone and could not come to a proper solution so I wanted to know how you guys think about this:

I have a html form and the other guy call him 'Aron' has got a .net system. My html form has a input text field called description. Aron his .net system catches my description Post and then changes this data in to XML.

BUT if a special character like & is posted, then he will get a parse error.

Now Aron is telling me that i need to post the & data as & and not as raw &.

What do you guys think about this?

  • 写回答

2条回答 默认 最新

  • dorflv5944 2015-12-14 10:36
    关注

    For me it sounds more like a server-side problem. If I were you, I would create an object, serialize it to JSON, send it to this .NET application and let .NET developer do whatever he needs with it. I have sent proper data in accordance with my arhitecture and language.

    It would be more proper and reasonable. Imagine the case - you don't work with Aron anymore, you work with Mark who takes your POST data and saves as plain text. He will ask "why are you sending HTML-encoded data to me? I do not need this". You definitely won't tell him "just decode it back" and you definitely don't want to change your code every time you change a partner. What if you work with both of them at the same time, or with 10 services at the same time?

    As a consumer of a service, you should not bother about how this service is implemented. Moreover, you may now know how it is implemented, and it shouldn't affect your code.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥20 想用ollama做一个自己的AI数据库
  • ¥15 关于qualoth编辑及缝合服装领子的问题解决方案探寻
  • ¥15 请问怎么才能复现这样的图呀