无法从复选框向REST传递正确的值

我正在尝试学习Web开发并尝试做一些基本的复选框教程,但我坚持将值发送给Rest Service。

我的意图是,例如,如果选中了两个复选框,我应该能够在我的Rest Service中捕获它并执行某些操作。

下面是HTML文件

   
Graph1
Graph2
Graph3
Graph4
$("#btnGetResponse").click(function() { var ids = $('[name="graphId"]:checked').map(function() { return this.id; }).get(); console.log(ids); $.ajax({ type: "GET", url: "http://localhost:51349/SMS_Rest.svc/v1/CheckBox", data: { graphId: ids }, contentType: "application/json; charset=utf-8", dataType: "json", success: function(response) { if (response == true) { alert('hello'); } }, failure: function(response) { alert('fail'); } }); });

如果我选择一个复选框,则生成的URL是:

 http://localhost:51349/SMS_Rest.svc/v1/CheckBox?graphId%5B%5D=1 

如果我选择TWO复选框,则生成的URL为:

  http://localhost:51349/SMS_Rest.svc/v1/CheckBox?graphId%5B%5D=1&graphId%5B%5D=2 

我需要在REST中进行哪些更改才能捕获所有选中的复选框。 我应该如何在我的REST服务中捕获它?

rest界面:

  Public Interface iSMS_Rest   Function CheckBox(ByVal c_Id As Integer) As Boolean End Interface 

rest实施:

  Public Function CheckBox(ByVal c_Id As Integer) As Boolean Implements iSMS_Rest.CheckBox 'Some Logic If c_Id = 1 Then Return True Else Return False End If End Function 

问题:我是否需要更改从HTML文件传递复选框映射值的方式。 或者我需要改变我在UriTemplate捕获请求的方式。 我的UriTemplate是:

请帮我。