<html>
<head><title></title></head>
<body>
<form action="https://oauth.vk.com/authorize?client_id=3343995&scope=photos,wall,offline&redirect_uri=http://example.com/vkontakte/auth&response_type=code" method="get">
<input type="submit" value="Auth">
</form>
</body>
</html>
你好。我遇到了这个HTML的问题。当我点击提交按钮时,我希望转到https://oauth.vk.com/authorize?client_id=3343995&scope=photos,wall,offline&redirect_uri=http://example.com/vkontakte/auth&response_type=code链接,但是我转到https://oauth.vk.com/authorize没有重定向。当我提交表单时,为什么这个URL会出错?
如果使用'action =“POST”',它会工作吗?用'action =“GET”',我认为动作URI中的查询字符串被替换为表单字段。 – Barmar
@Barmar我认为你是对的,如果你看看我的答案,将查询参数置于隐藏字段中正确地将它们传递到URL中(并正确地对其进行URL编码)。我正在窃取你的想法并将其放入我的答案:) –