无法显示您要查找的页面,因为使用了无效方法(HTTP 动词) [英] The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used

查看:58
本文介绍了无法显示您要查找的页面,因为使用了无效方法(HTTP 动词)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 SSO 身份验证后重定向到 Angular Web 应用程序(Azure Web 应用程序)时,我收到错误消息由于使用了无效方法(HTTP 动词),因此无法显示您正在查找的页面."

While redirecting after SSO Authentication to Angular web app(Azure web app),I'm getting error as "The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used."

推荐答案

出现此错误的原因有几个.您正在使用的方法可能不被允许 - 例如,如果客户端通过将 POST 方法发送到未配置为处理它的页面来发出 HTTP 请求.您可能有一个需要一些参数的 API,但您没有从 Angular 传递这些参数.

There are a few reasons why this error might occur. It is possible that a method you are using is not allowed - for example, if the client makes an HTTP request by sending the POST method to a page that is not configured to handle it. You may have an API which needs some argument but you are not passing those arguments from your Angular.

可以参考几个线程 在 MSDN 和 Stackoverflow 上,其他人也遇到了同样的问题.

You can refer to several threads on MSDN and Stackoverflow where others have faced the same issue.

以下是 微软官方指南.

原因一:客户端使用不符合HTTP规范的HTTP方式发起HTTP请求,导致出现此问题.

Cause 1: This problem occurs because the client makes an HTTP request by using an HTTP method that does not comply with the HTTP specifications.

解决方案 1:

确保客户端发送的请求包含有效的 HTTP 方法.为此,请按以下步骤操作:

Make sure that the client sends a request that contains a valid HTTP method. To do this, follow these steps:

  1. 单击开始,在开始搜索框中键入记事本,右键单击记事本,然后单击以管理员身份运行.注意:如果系统提示您输入管理员密码或进行确认,请输入密码或进行确认.
  2. 在文件菜单上,单击打开.在文件名框中,键入 %windir%\system32\inetsrv\config\applicationhost.config,然后单击打开.
  3. 在 ApplicationHost.config 文件中,找到标记.
  4. 确保所有处理程序都使用有效的 HTTP 方法.
  5. 保存 ApplicationHost.config 文件.

原因 2:出现此问题是因为客户端通过将 POST 方法发送到配置为由 StaticFile 处理程序处理的页面来发出 HTTP 请求.例如,客户端将 POST 方法发送到静态 HTML 页面.但是,为 StaticFile 处理程序配置的页面不支持 POST 方法.

Cause 2: This problem occurs because a client makes an HTTP request by sending the POST method to a page that is configured to be handled by the StaticFile handler. For example, a client sends the POST method to a static HTML page. However, pages that are configured for the StaticFile handler do not support the POST method.

解决方案 2:

将 POST 请求发送到配置为由除 StaticFile 处理程序以外的处理程序(例如,ASPClassic 处理程序)处理的页面.或者,更改 StaticFile 处理程序正在处理的请求,使其成为 GET 请求而不是 POST 请求.

Send the POST request to a page that is configured to be handled by a handler other than the StaticFile handler (for example, the ASPClassic handler). Or, change the request that is being handled by the StaticFile handler so that it is a GET request instead of a POST request.

这篇关于无法显示您要查找的页面,因为使用了无效方法(HTTP 动词)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆