简体   繁体   English

Azure API 管理层回应 404

[英]Azure API Management responses 404

I've created simple Web API using Microsoft Azure. When I make simple call by link http://taskswebapp.azurewebsites.net/api/tasks/ it returns JSON string properly.我使用 Microsoft Azure 创建了简单的 Web API。当我通过链接http://taskswebapp.azurewebsites.net/api/tasks/进行简单调用时,它会正确返回 JSON 字符串。 Than I've created Azure API Management with following settings:比我创建 Azure API 管理具有以下设置:

And new operation:和新操作:

  • HTTP verb*: GET HTTP 动词*:获取
  • URL template: /tasks URL 模板:/tasks

When I try to make this call on API Management Developers Portal, it responses 404.当我尝试在 API 管理开发人员门户上进行此调用时,它会响应 404。

Ocp-Apim-Trace-Location: https://apimgmtstep0m850qbbqfy1r.blob.core.windows.net/apiinspectorcontainer/N8BZ_bvg_tqqEKKM3-9CFg2-26?sv=2014-02-14&sr=b&sig=LOoq%2Bpp%2B8TMgiAzir%2BqxrZv4WsVN6LeVg1bR%2Fjjh0ag%3D&se=2015-10-19T11%3A47%3A22Z&sp=r&traceId=1b3f1ff48b5d400799b497337e299213 Date: Sun, 18 Oct 2015 11:47:22 GMT Set-Cookie: ARRAffinity=47ee33511877c67ac64671db4dc13c4d3d30ad6daa9c461e9a39036fc4112292;Path=/;Domain=taskswebapp.azurewebsites.net X-Powered-By: ASP.NET Content-Length: 103 Content-Type: text/html Ocp-Apim-Trace-Location: https://apimgmtstep0m850qbbqfy1r.blob.core.windows.net/apiinspectorcontainer/N8BZ_bvg_tqqEKKM3-9CFg2-26?sv=2014-02-14&sr=b&sig=LOoq%2Bpp%2B8TMgiAzir%2BqxrZv4WsVN6LeVg1bR%2Fjjh0ag% 3D&se=2015-10-19T11%3A47%3A22Z&sp=r&traceId=1b3f1ff48b5d400799b497337e299213 Date: Sun, 18 Oct 2015 11:47:22 GMT Set-Cookie: ARRAffinity=47ee33511877c67ac64671db4dc13c4d3d30ad6daa9c461e9a39036fc4112292;Path=/;Domain=taskswebapp.azurewebsites.net X-Powered -作者:ASP.NET 内容长度:103 内容类型:文本/html

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.您要查找的资源已被删除、更名或暂时不可用。 Blockquote块引用

Web Service URL should be http://taskswebapp.azurewebsites.net/api Web服务URL应为http://taskswebapp.azurewebsites.net/api

Web API URL suffix is the suffix for the public facing URL (ie, foo.azure-api.net/) Web API URL后缀是面向公众的URL(即foo.azure-api.net/)的后缀

Another reason for 404 can be an incorrectly defined route in the frontend section. 404 的另一个原因可能是前端部分中错误定义的路由。

eg /resource is fine while /resource/ will lead to a 404.例如 /resource 很好,而 /resource/ 会导致 404。

This can easily happen if you work with path variables, because the initial frontend route value has to be corrected (it puts some variable stuff there)如果您使用路径变量,这很容易发生,因为必须更正初始的前端路由值(它在那里放置了一些变量)

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

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