Azure API Mgmt是否对路径/参数有长度限制? [英] Do Azure API Mgmt have a length limit on path/parameters?

查看:77
本文介绍了Azure API Mgmt是否对路径/参数有长度限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Azure API Management中发布了一些API,这些API在后台调用REST Web应用程序.大多数端点使用以下格式:

I have some APIs published in Azure API Management, that call a REST web application behind the scenes. Most of the endpoints use the format:

https://company.azure-api.net/dom/ep/{pathParamVal}?{queryParamName}={queryParamVal}

如果{queryParamVal}是一个非常长的字符串,导致URL长度超过350-400个字符,则一切正常.但是,如果指定与{pathParamVal}相同的字符串值,则会收到HTTP 400错误代码-HTTP Error 400. The request URL is invalid..我知道这与Azure有关,因为底层的Web应用程序可以使用冗长的路径参数以及查询参数.

If {queryParamVal} is a really long string which causes the URL length to exceed 350-400 characters, everything works as expected. But if I specify that same string value as the {pathParamVal}, I get a HTTP 400 error code - HTTP Error 400. The request URL is invalid.. I know this is related to Azure, because the underlying web application works with lengthy path parameters as well as query parameters.

URL路径可以有多长?

Is there a limitation on how long the URL path can be?

推荐答案

URL路径可以有多长?

Is there a limitation on how long the URL path can be?

根据我的经验,WebAPI路径的限制为260个字符,与 SO线程.

Base on my experience, the limition of the WebAPI path is 260 characters that same as the Windows Maximum Path Length Limitation.The Maximum length of URL is limited by the different browsers. More details about the maximum length of a url in different browsers please refer to another SO thread.

更新:

我对此进行了测试.如果pathParamVal的长度> 260,则将得到错误的请求.或它正常工作.更多详细信息,请参阅屏幕截图.

I do a test for it. If the length of pathParamVal >260 then will get the bad request. Or it works correctly. More detail please refer to the screenshots.

  1. 如果pathParamval的长度> 260,则将收到400错误的请求错误.

  1. 如果pathParamval的长度= 260,则它可以正常工作.

这篇关于Azure API Mgmt是否对路径/参数有长度限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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