我需要将一组对象从我的 Web 应用程序发送到我的 Nancy Web 服务,以更新我的数据库。
只发送一个对象,它工作正常:在我的网络方法中,我使用Request.Form.<data>.Value.Trim()
. 但是,如果我尝试发送数据数组,那将不起作用。
那么如何在我的 Nancy web 方法中获取和处理一组数据呢?
->我尝试发送的序列化对象:
“data[0][Id]=56&data[0][SatisM]=1&data[0][Type]=0&data[0][Commentaire]=com&data[0][Month] =3&data[1][Id]=57&data[1][SatisM]=2&data[1][Type]=1&data[1][Commentaire]=com1&data[1][月]=3&data[2][Id]=58&data [2][SatisM]=1&data[2][Type]=2&data[2][Commentaire]=com2&data[2][Month]=3&data[3][Id]=59&data[3][SatisM]=3&data[3 ][类型]=3&data[3][评论]=com3&data[3][月份]=3"
-> 相同但编码的 %22data%5B0%5D%5BId%5D=56&data%5B0%5D%5BSatisM%5D=1&data%5B0%5D%5BType%5D=0&data%5B0%5D%5BCommentaire%5D=com&data%5B0 %5D%5BMonth%5D=3&data%5B1%5D%5BId%5D=57&data%5B1%5D%5BSatisM%5D=2&data%5B1%5D%5BType%5D=1&data%5B1%5D%5BCommentaire%5D=com1&data%5B1 %5D%5BMonth%5D=3&data%5B2%5D%5BId%5D=58&data%5B2%5D%5BSatisM%5D=1&data%5B2%5D%5BType%5D=2&data%5B2%5D%5BCommentaire%5D=com2&data%5B2 %5D%5BMonth%5D=3&data%5B3%5D%5BId%5D=59&data%5B3%5D%5BSatisM%5D=3&data%5B3%5D%5BType%5D=3&data%5B3%5D%5BCommentaire%5D=com3&data%5B3 %5D%5B月%5D=3%22