I have this code that I am using to PUT my JSON string on Firebase database:

```
RestRequest request = new RestRequest("MemberAndChannels/{userId}/{channelId}.json", Method.POST);

request.RequestFormat = DataFormat.Json;
request.AddParameter("auth", accessKey);
request.AddUrlSegment("userId", user.UUID);
request.AddUrlSegment("channelId", channel.UUID);
request.AddHeader("Content-Type", "application/json; charset=utf-8");

request.AddJsonBody(channelJson);

IRestResponse response = client.Execute(request);

if (response.StatusCode == HttpStatusCode.OK)
{

} 
else {

}

```

But I am getting following error (StatusCode: BadRequest):

```
"{\n  \"error\" : \"Invalid data; couldn't parse JSON object, array, or value.\"\n}\n"

```

I've tried PUTing same data using curl and it worked. Can't figure out where I am doing wrong.