使用 GET 请求而不是 POST 请求
问题是我要填写一张表格。它是通过 POST 请求提交的。但从技术上讲,我只能使用 GET 请求(传递带有 GET 参数的 URL)。而且我无法访问该网站(需要填写表格)所在的服务器。
我尝试在 GET 请求中使用 POST 参数,但没有成功。我想到的另一件事是将 GET 请求发送到我自己的服务器,该服务器将执行所需的 POST 请求。但我需要从我的 IP 提交请求,而不是从服务器的 IP 提交......
任何人都可以提供一些关于解决此问题的建议吗?
The issue is that there is a form I want to fill. It's submitted via a POST request. But technically I can use only GET requests (pass an URL with GET parameters). And I don't have access to a server where the site (with a form to fill) is located.
I've tried to use POST params in GET request, but it didn't work. The other thing that came to my mind was to send GET request to my own server, which will perform the desired POST request. But I need the request to be commited from my IP, but not from the server's one...
Can anybody give some piece of advice concerning solving this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是作业吗?您无法使用 POST 似乎很奇怪。
无论如何,
最好的方法是重写提交按钮的 onclick 事件; JS 函数可以轮询您要提交的字段。然后对值使用encodeURIComponent(),将它们正确发送到您的网络服务器。
在这里,您可以使用 get?element=value&.... 请求加载新页面。
http://www.w3schools.com/jsref/jsref_encodeURIComponent.asp
Is this homework? Seems odd that you wouldn't be able to use a POST.
Regardless,
The best way to do this would be to override the onclick event of your submit button; the JS function could poll for the fields you are looking to submit. Then use encodeURIComponent() on the values to get them sent to your webserver correctly.
Here you would be able to load the new page with the get?element=value&.... request.
http://www.w3schools.com/jsref/jsref_encodeURIComponent.asp
Firefox 允许您将至少一个常规文本输入字段的 HTML 表单(GET 或 POST)转换为搜索关键字书签,尽管我不确定从一份 Firefox 导入和导出单个书签有多容易到另一个。
Firefox allows you to turn an HTML form (either GET or POST) with at least one regular text input field into a search keyword bookmark, although I'm not sure how easy it is to import and export an individual bookmark from one copy of Firefox to another.