I had to make a modification to the CouchDatabase.HasDatabase method, as it was it was causing strange timeout issues to occur with subsequent calls. I believe the reason for this is that it was always returning "True" as it was due to CouchDB returning a 200 status code and some error JSON even if it doesn't exist, the method was only checking for a 200 status code.
public bool HasDatabase(string databaseName)
var request = GetRequest(baseUri + databaseName);
request.Timeout = -1;
HttpWebResponse response = request.GetResponse();
Document pDocResult = new Document(response.GetResponseString());
if (pDocResult["error"] == null)
else if (pDocResult["error"].Value<String>() == "not_found")
throw new Exception(pDocResult["error"].Value<String>());
Nice catch.. It'd be great if you could send me a pull request for this change.
BugFix #15: it was causing strange timeout issues to occur with subse…
I've merged in your method slightly altered.