Search code examples
c#web-servicesrestpostfiddler

How to pass values to string array in post method using Fiddler?


When I'm passing the values in Fiddler like {"rajehs","ramesh","ramsgkfhh"}, I'm getting all the values in [0] location. I've also tried by using = {"rajehs","ramesh","ramsgkfhh"}.

I declared the method like :

    public void Post([FromBody]string[] value)
    {

    }

Solution

  • You are passing a JSON object in our body, instead of an array. Use [] to pass a JSON array:

    ["rajehs","ramesh","ramsgkfhh"]