Hello,
I’m getting a “bad request” when trying to do this against Couchbase 6.6
string postData= "name=activities&bucketType=ephemeral&ramQuotaMB=4364&evictionPolicy=nruEviction&replicaIndex=0&flushEnabled=1";
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] data = encoding.GetBytes(postData);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:8091/pools/default/buckets");
request.PreAuthenticate = true;
request.Credentials = new NetworkCredential("administrator", "mypassword");
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
using (Stream stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
var response = (HttpWebResponse)request.GetResponse();
response.Close();