Postman-生成代码片段-不适用于C#RestSharp

Postman-生成代码片段-不适用于C#RestSharp,postman,Postman,我创建了一个邮递员请求。JSON的基本“发布”。在《邮递员》中效果很好! 当我在PostMan中单击“Code”并为C#RestSharp选择生成代码片段时,它会生成以下内容: var client = new RestClient("https://localhost:44331/api/workorder"); client.Timeout = -1; var request = new RestRequest(Method.GET); request.AddHeader("Content-

我创建了一个邮递员请求。JSON的基本“发布”。在《邮递员》中效果很好! 当我在PostMan中单击“Code”并为C#RestSharp选择生成代码片段时,它会生成以下内容:

var client = new RestClient("https://localhost:44331/api/workorder");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", " { \"dataSource\":\"Axw163\",\"Number\":\"3450489\",\"UserId\":\"XXX\",\"Password\":\"XXX\",\"EndPoint\":\"http://MYENDPOINT\",\"App\": \"WORK\"}\r\nstrong text",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
当我将代码粘贴到我的应用程序并运行它时,我得到以下信息:

var client = new RestClient("https://localhost:44331/api/workorder");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", " { \"dataSource\":\"Axw163\",\"Number\":\"3450489\",\"UserId\":\"XXX\",\"Password\":\"XXX\",\"EndPoint\":\"http://MYENDPOINT\",\"App\": \"WORK\"}\r\nstrong text",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
你知道为什么它在Postman中有效而在生成的C代码中无效吗

邮递员来了

"id": "a59638d6-4f81-4318-bc55-181a088c00a4",
                    "name": "https://localhost:44331/api/workorder",
                    "url": "https://localhost:44331/api/workorder",
                    "description": "Get Work Order",
                    "data": [],
                    "dataOptions": {
                        "raw": {
                            "language": "json"
                        }
                    },
                    "dataMode": "raw",
                    "headerData": [
                        {
                            "key": "Content-Type",
                            "name": "Content-Type",
                            "value": "application/json",
                            "description": "",
                            "type": "text"
                        }
                    ],
                    "method": "GET",
                    "pathVariableData": [],
                    "queryParams": [],
                    "auth": null,
                    "events": null,
                    "folder": null,
                    "protocolProfileBehavior": {
                        "disableBodyPruning": true
                    },
                    "currentHelper": null,
                    "helperAttributes": null,
                    "collectionId": "64bf01de-822f-41d3-b596-7c351a8665e8",
                    "rawModeData": " { \"dataSource\":\"XXX\",\"Number\":\"3450489\",\"UserId\":\"XXX\",\"Password\":\"XX\",\"EndPoint\":\"http://xxxxxxxxxcloudapp.azure.com/AppXtenderrest\",\"App\": \"WMIS_WORK_REQUEST\"}\r\n            ",
                    "headers": "Content-Type: application/json\n",
                    "pathVariables": {}

你能在《邮递员》中发布你的请求吗?我的时间太长了,无法发布