1 つの HTTP GET メソッドで非常に単純なエンドポイントを作成しました。ApiMethod という名前のパラメーターとして 1 つの文字列を渡します。
@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
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>
それはバグですか、それとも機能ですか?それとも、私はそれを間違っていますか?