简体   繁体   English

获取网站发送给自己的POST请求?

[英]Fetch a POST request that a site is sending to itself?

So I'm creating an app for a specific website, which has comments on certain articles/entities or whatever. 因此,我正在为特定网站创建一个应用,其中包含对某些文章/实体或其他内容的评论。 I already know how to fetch those comments with RSS, but I'm also curious if I can implement a reply functionality from the app itself. 我已经知道如何使用RSS获取这些评论,但是我也很好奇我是否可以从应用程序本身实现回复功能。 The site doesn't have an API for that, but I know that when you write a comment, it sends a POST request with the contents of the form. 该站点没有用于此的API,但是我知道当您编写注释时,它将发送带有表单内容的POST请求。

Is there a way to find out what that POST request looks like, so I can send a similar one from my app? 有没有办法找出POST请求的外观,以便我可以从我的应用程序发送类似的请求? The end goal is to be able to reply/post new comments from my app to that website. 最终目标是能够将我的应用中的新评论回复/发布到该网站。

Any thoughts? 有什么想法吗? Just in theory. 从理论上讲。

Is there a way to find out what that POST request looks like, so I can send a similar one from my app? 有没有办法找出POST请求的外观,以便我可以从我的应用程序发送类似的请求?

Use some debuger, like FireBug for FF or DragonFly for Opera . 使用一些调试器,例如FF的FireBugOpera的DragonFly

so I can send a similar one from my app? 这样我可以从我的应用发送类似的邮件吗?

It would be not secure if anyone could see the nature of requests and make such requests in their apps. 如果任何人都可以看到请求的性质并在其应用程序中发出此类请求,那将是不安全的 Apps may be bad and send spam . 应用可能很糟糕,并且会发送垃圾邮件
There should be some Captcha or CSRF protection. 应该有一些验证码CSRF保护。
If there is - you plan will not work . 如果有-您的计划将行不通
If there isn't - it is security hole . 如果没有,那就是安全漏洞

My advice. 我的建议。 Better create some API an call it from your APP. 最好创建一些API,从您的APP中调用它。
Simple HTTP , XML-RPC , or SOAP . 简单的HTTPXML-RPCSOAP
This will be more secure and nice usefull thing to know. 这将是更安全和有用的知识。

Look at the page which sends the post request. 查看发送帖子请求的页面。 If the HTML code or javascript is simple you can understand which is the POST data sent to the server. 如果HTML代码或javascript很简单,则可以了解发送到服务器的POST数据。 Otherwise maybe you have access to the server and can look at the code there? 否则,也许您可​​以访问服务器并可以在其中查看代码?

Point your browser with Chrome or Firefox (with the Firebug plugin) and open the inspector (Control-Alt-I / Command-Alt-I), then the "Network" tab. 将您的浏览器指向Chrome或Firefox(带有Firebug插件),然后打开检查器(Control-Alt-I / Command-Alt-I),然后打开“网络”标签。 There you'll see real-time requests and responses to the server. 在这里,您会看到对服务器的实时请求和响应。

If you need to implement authentication from your app, google "cookie jar" and your language. 如果您需要通过应用,谷歌“ cookie jar”和您的语言来实现身份验证。

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

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