简体   繁体   English

从背后的代码发布到第三方

[英]Posting to a third party from code behind

I have been given some generated code which looks like so: 我得到了一些看起来像这样的生成代码:

<form id="form1" method="post" action="https://applications.first-contact.biz/WebFormPosts/default.aspx">

<!-- Form fields -->

</form>

I can dump this on a page and successfully post the form to a third party website. 我可以将其转储到页面上,然后将表单成功发布到第三方网站。 What I would like now is to have control over the post back so that it does not immediately post to the third party, but instead posts back to itself which, once validated, then posts onto the third party. 我现在想要的是对发回邮件进行控制,这样它就不会立即发给第三方,而是发回自身,一旦经过验证,便会发给第三方。

Is there a way to do this or am I stuck with validating using Javascript? 有没有办法做到这一点,还是我坚持使用Java验证?

A side question, are there security complications which come with posting cross domain in this manner? 附带的问题是,以这种方式发布跨域是否会带来安全复杂性?

Doing an auto-re-postback from Javascript seems awkward. 从Javascript执行自动重新发布似乎很尴尬。 I think a better solution is to have your server act as a proxy for the post request. 我认为更好的解决方案是让您的服务器充当发布请求的代理。 Do the validation, then construct an HttpWebRequest and post it to the third party, with the same post data and user agent. 进行验证,然后构造一个HttpWebRequest并将其发布到具有相同发布数据和用户代理的第三方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM