如何发送JSON有效载荷

时间:2019-06-18 03:06:19

标签: c# json

我无法将有效载荷发送到API

我尝试了多个代码,但是没有一个起作用

string response = request.Start(HttpMethod.POST,
                            new Uri("https://api.myapi.com/profiles/users"),
                            new BytesContent(Encoding.UTF8.GetBytes(""[/"" + myname "/",/"nonExistingPlayer/"]""))).ToString();

我希望它返回此值:

[
  {
    "id": "myid",
    "name": "myname",
    "legacy": true,
    "demo": true
  }
]

0 个答案:

没有答案