Permalink
Browse files

Extracted ICouchRequest interface

  • Loading branch information...
1 parent 58f000a commit b8775a0b859baee7cfc7fefc2335dcadf26e3926 Sebastian Negomireanu committed Dec 10, 2009
Showing with 37 additions and 1 deletion.
  1. +1 −1 src/CouchRequest.cs
  2. +1 −0 src/Divan.csproj
  3. +35 −0 src/ICouchRequest.cs
View
@@ -14,7 +14,7 @@ namespace Divan
/// <summary>
/// A CouchDB HTTP request with all its options. This is where we do the actual HTTP requests to CouchDB.
/// </summary>
- public class CouchRequest
+ public class CouchRequest : Divan.ICouchRequest
{
private const int UploadBufferSize = 100000;
private readonly ICouchDatabase db;
View
@@ -68,6 +68,7 @@
<Compile Include="ICanJson.cs" />
<Compile Include="ICouchDatabase.cs" />
<Compile Include="ICouchDocument.cs" />
+ <Compile Include="ICouchRequest.cs" />
<Compile Include="ICouchServer.cs" />
<Compile Include="ICouchViewDefinition.cs" />
<Compile Include="ICouchViewDefinitionBase.cs" />
View
@@ -0,0 +1,35 @@
+using System;
+namespace Divan
+{
+ public interface ICouchRequest
+ {
+ CouchRequest AddHeader(string key, string value);
+ CouchRequest Check(string message);
+ CouchRequest Copy();
+ CouchRequest Data(System.IO.Stream dataStream);
+ CouchRequest Data(string data);
+ CouchRequest Data(byte[] data);
+ CouchRequest Delete();
+ string Etag();
+ CouchRequest Etag(string value);
+ CouchRequest Get();
+ CouchRequest Head();
+ bool IsETagValid();
+ CouchRequest MimeType(string type);
+ CouchRequest MimeTypeJson();
+ T Parse<T>() where T : Newtonsoft.Json.Linq.JToken;
+ Newtonsoft.Json.Linq.JObject Parse();
+ CouchRequest Path(string name);
+ CouchRequest Post();
+ CouchRequest PostJson();
+ CouchRequest Put();
+ CouchRequest Query(string name);
+ CouchRequest QueryOptions(System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string, string>> options);
+ System.Net.WebResponse Response();
+ T Result<T>() where T : Newtonsoft.Json.Linq.JToken;
+ Newtonsoft.Json.Linq.JObject Result();
+ CouchRequest Send();
+ Newtonsoft.Json.JsonTextReader Stream();
+ string String();
+ }
+}

0 comments on commit b8775a0

Please sign in to comment.