Commits

Jeremy Sandell committed f8235d9 Draft

moving things around

Comments (0)

Files changed (1)

requests/request.d

+module request;
+
+private {
+    import std.socket : InternetAddress, TcpSocket, Socket;
+    import std.typecons : Tuple, tuple;
+    import std.string: format;
+    import util.encoding;
+}
+
+debug=info;
+
+debug(info)
+{
+    private import std.stdio : writefln;
+}
+
+
+enum request_method 
+{
+    GET,
+    POST,
+    PUT,
+    OPTIONS,
+    DELETE
+}
+
+class Session {
+    alias Tuple!(string, "name", string, "value") Header;
+    Header[] headers;
+
+    alias Tuple!(string, "username", string, "password") Auth;
+    Auth auth;
+
+    this()
+    {
+    }
+
+    Response request(request_method method, string url,
+                     params  = null,
+                     data    = null,
+                     headers = null,
+                     cookies = null,
+                     auth    = null,
+                     timeout = null)
+            {
+                return Response();
+            }
+             
+
+}
+
+class Response {
+}
+
+class Request {
+    Socket sock;
+
+    this()
+    {
+
+    }
+}
+
+
+unittest
+{
+    auto r = new Request;
+    auto s = new Session;
+
+    debug(info) writefln("foo");
+}