使用gapi.client.request

时间:2017-10-24 13:15:22

标签: google-app-engine

我正在尝试将参数从前端发送到谷歌应用引擎中的API方法这是我的前端代码:

$scope.SubmitSelection = function(){
    var PG_name = $scope.PG_name;
    var request = gapi.client.request({
        'path': 'http://localhost:8080/_ah/api/orederingEndpoints/v1/SetSelection',
        'params':{'query':PG_name}
    }).then(function(response) {
        console.log(response);
});

这是我的后端代码:

@apimethod(name = "SetSelection", httpMethod = HttpMethod.GET)
public void SetSelection( @nAmed("query") String query ) throws Exception{
    String PG_Name= query;
    System.out.println(PG_Name);
}

这是我的错误:

  

http://localhost:8080/_ah/api/orederingEndpoints/v1/SetSelection?query=CIC   404(未找到)

0 个答案:

没有答案