[英]Cloud Endpoints generating HTTP 404 for special characters passed as named parameter
我用一個HTTP GET方法創建了非常簡單的端點。 我正在傳遞一個字符串作為ApiMethod命名參數:
@Api (name = "sample_endpoint")
public class SampleEndpoint
{
public Entity get(@Named("parameter") String parameter)
{
return new Entity(parameter);
}
public class Entity
{
public String parameter = "Validated ok.";
public Entity(String parameter) { this.parameter = parameter; }
public String getParameter() { return parameter; }
}
}
當我使用包含字母和數字的參數以及一些特殊字符調用URL時,例如-.
, 有用:
GET http://localhost:8888/_ah/api/sample_endpoint/v1/entity/passedparam
200 OK
{
"parameter": "passedparam"
}
但是當我在參數中插入某些特殊字符時,例如:#/
,我正在獲取HTTP 404.參數是URL編碼的,例如我正在使用passed:param
值passed:param
GET http://localhost:8888/_ah/api/sample_endpoint/v1/entity/passed%3Aparam
404 Not Found
<html><head><title>Error 404</title></head>
<body><h2>Error 404</h2></body>
</html>
是bug還是功能? 或者也許我做錯了?
這已經從App Engine SDK 1.8.6解決了
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.