如何在C#中形成一个POST(方法)json的请求体 [英] How to form a request body to POST(method) a json in C#

查看:1061
本文介绍了如何在C#中形成一个POST(方法)json的请求体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面附上的是要求的JSON。任何人都可以帮助我生成/创建一个请求体。

Hi, Attached below is the reqst JSON. can any one help me on generating/ creating a request body for the same.

{
  "groups": [{
      "groupName": "abc",
      "questions": [{
          "questionID": "",
          "groupedIndexVlaue": 2,
          "indexvalue": 6
        }, {
          "questionID": "",
          "groupedIndexVlaue": 2,
          "indexvalue": 6
        }

      ]
    }, {
      "groupName": "xyz",
      "questions": [{
          "questionID": "",
          "groupedIndexVlaue": 2,
          "indexvalue": 6
        }, {
          "questionID": "",
          "groupedIndexVlaue": 1,
          "indexvalue": 7
        }
      ]
    }
  ]
}





我需要像下面这样的请求体来使用post方法。请任何人建议我如何根据上述Json形成请求体。





I need the request body like below to work with post method. Please any one suggest me how to form the request body as per the above Json.

{
  "Items": [{
      "questionID": 1,
      "groupedIndexVlaue": 5,
      "indexvalue": 5
    }, {
      "questionID": 2,
      "groupedIndexVlaue": 5,
      "indexvalue": 5
    }

  ]
}





谢谢。



我尝试了什么:



下面附上的是要求的JSON。任何人都可以帮助我生成/创建一个请求体。



Thanks.

What I have tried:

Attached below is the reqst JSON. can any one help me on generating/ creating a request body for the same.

推荐答案

创建请求JSON .net - Google搜索 [ ^ ]。


这篇关于如何在C#中形成一个POST(方法)json的请求体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆