Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/303.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在REST服务器中使用GET方法发送参数_C#_Rest_Visual C++_Casablanca_Cpprest Sdk - Fatal编程技术网

C# 在REST服务器中使用GET方法发送参数

C# 在REST服务器中使用GET方法发送参数,c#,rest,visual-c++,casablanca,cpprest-sdk,C#,Rest,Visual C++,Casablanca,Cpprest Sdk,我有一个简单的REST服务器获取方法: public class PersonController : ApiController { // GET: api/Person public IEnumerable<string> Get() { return new string[] { "value1", "value2" }; } ... } 服务器: public IEnum

我有一个简单的REST服务器获取方法:

    public class PersonController : ApiController
    {
        // GET: api/Person
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }
...
}
服务器:

public IEnumerable<string> Get([FromBody]string value)

删除
[FromBody]
Get请求没有body我已经删除了[FromBody],但这并没有解决问题,请尝试在您的操作上添加
[HttpGet]
[Route(“Get/{value}”)]
属性。
http_response httpResponse = httpClient.request(methods::GET,L"HELLO").get();
public IEnumerable<string> Get([FromBody]string value)
public IEnumerable<string> Get(string value)