【问题标题】:GAE TaskQueue hitting Endpoints APIGAE TaskQueue 命中 Endpoints API
【发布时间】:2014-11-14 23:15:24
【问题描述】:

我有一个名为“gameApi”的端点 api

我有一个名为:

@ApiMethod(name = "startNewRound", path = "evaluateRound", httpMethod = HttpMethod.POST)

我正在尝试运行以下任务队列:

queue.add( ofy().getTransaction(), TaskOptions.Builder.withUrl("/_ah/api/gameApi/v1/evaluateRound") .param("gameId", gameId.toString()) .method(TaskOptions.Method.POST) .countdownMillis(5000));

我在日志中收到 404:

0.1.0.2 - - [14/Nov/2014:14:58:28 -0800] "POST /_ah/api/gameApi/v1/evaluateRound HTTP/1.1" 404 234 "https://some-appspot-123.appspot.com/_ah/spi/com.appspot.some_appspot_123.spi.GameAPI.playCard" "AppEngine-Google ; (+http://code.google.com/appengine)" "some-appspot-123.appspot.com" ms=8 cpu_ms=21 cpm_usd=0.000026 queue_name=default task_name=62689306220576549071 instance=00c61b117c54ec2fb802c51c19fe26523ec_engine.165p_release1=。

看起来它访问的是 HTTP 而不是 HTTPS 页面。有没有办法强制它使用 HTTPS?

【问题讨论】:

    标签: google-app-engine google-cloud-endpoints task-queue


    【解决方案1】:

    在端点中,HTTP 404 对应于com.google.api.server.spi.response.NotFoundException

    有没有可能是该方法没有在 API 类中定义,或者它没有a correct annotation

    此外,它似乎没有访问 http,跟踪清楚地显示 https 作为协议。我认为只能在 localhost 上使用 http。

    【讨论】:

    • 我可以使用 javascript api 打它
    猜你喜欢
    • 2016-03-21
    • 1970-01-01
    • 1970-01-01
    • 2015-03-17
    • 2015-06-22
    • 2016-05-15
    • 1970-01-01
    • 2016-12-29
    • 1970-01-01
    相关资源
    最近更新 更多