0

我有以下 WebGet:

    [WebGet(UriTemplate = "GetAssignments/{data}")]
    [Description("GetAssignments")]
    BASE.BaseResponse<object> GetAssignments(String data); 

如此称呼:

    var data = JSON.stringify(advancedSearchDataXml);

    Helper.Service.Call({
        api: 'HomeApi',
        url: '?method=GetAssignments/' + data,
        method: 'GET',
        //data: advancedSearchDataXml,
        controlId: '',
        showProgress: true,
        onSuccess: function (result) {
    ...

数据在哪里

{"searchquery":
    "<SearchQuery>
        <genericsearch></genericsearch>
        <region>MA</region><market>RL</market>
        <recordcount>5000</recordcount>
    </SearchQuery>"
}

这将失败并显示“异常:远程服务器返回错误:(400)错误请求”消息。我究竟做错了什么?

4

1 回答 1

0

Try removing the ?method= instead have only 'GetAssignments/'+ data .. also add a break point in your controller to make sure the right method is being hit.

于 2016-12-21T16:41:17.373 回答