From c243ae43f23be20ec3388ed30e8b7b806ad2a2a7 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Tue, 21 Jul 2009 06:47:29 +0000 Subject: * Updated C# WebServer to the latest available source download (r19869) and applied a few mods from the old version (now up on opensim-libs (VS 3.5 project). * Made various changes to BaseHttpServer to accommodate the new interfaces. * This version has been significantly re-architected and may fail in unusual and insidious ways. * Please pay attention to any errors you get and post a Mantis if you can reproduce an issue with the HTTPServer. I'm including the pdb and having the http server compiled in debug for a few weeks so that when an error occurs, it'll print the pertenant data. * Once again, this is the full C# WebServer, not the lite branch that is included in LibOMV (we need SSL!) --- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 19 +- OpenSim/Framework/Servers/Tests/OSHttpTests.cs | 31 + OpenSim/Region/UserStatistics/Default_Report.cs | 6 +- OpenSim/Region/UserStatistics/WebStatsModule.cs | 6 +- ThirdPartyLicenses/C# Webserver.txt | 148 +- bin/HttpServer_OpenSim.dll | Bin 139776 -> 123904 bytes bin/HttpServer_OpenSim.pdb | Bin 0 -> 341504 bytes bin/HttpServer_OpenSim.xml | 8168 ++++++++------------ 8 files changed, 3388 insertions(+), 4990 deletions(-) create mode 100644 bin/HttpServer_OpenSim.pdb diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index ef61200..4532e76 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -226,6 +226,15 @@ namespace OpenSim.Framework.Servers.HttpServer return true; } + private void OnRequest(object source, RequestEventArgs args) + { + IHttpClientContext context = (IHttpClientContext)source; + IHttpRequest request = args.Request; + + OnHandleRequestIOThread(context,request); + + } + public void OnHandleRequestIOThread(IHttpClientContext context, IHttpRequest request) { OSHttpRequest req = new OSHttpRequest(context, request); @@ -1406,7 +1415,7 @@ namespace OpenSim.Framework.Servers.HttpServer { //m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); //m_httpListener.Prefixes.Add("http://10.1.1.5:" + m_port + "/"); - m_httpListener2 = new CoolHTTPListener(m_listenIPAddress, (int)m_port); + m_httpListener2 = CoolHTTPListener.Create(m_listenIPAddress, (int)m_port); m_httpListener2.ExceptionThrown += httpServerException; m_httpListener2.LogWriter = httpserverlog; @@ -1414,7 +1423,7 @@ namespace OpenSim.Framework.Servers.HttpServer // if you want more detailed trace information from the HttpServer //m_httpListener2.UseTraceLogs = true; - m_httpListener2.DisconnectHandler = httpServerDisconnectMonitor; + //m_httpListener2.DisconnectHandler = httpServerDisconnectMonitor; } else { @@ -1422,7 +1431,7 @@ namespace OpenSim.Framework.Servers.HttpServer //m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); } - m_httpListener2.RequestHandler += OnHandleRequestIOThread; + m_httpListener2.RequestReceived += OnRequest; //m_httpListener.Start(); m_httpListener2.Start(64); HTTPDRunning = true; @@ -1474,10 +1483,10 @@ namespace OpenSim.Framework.Servers.HttpServer { HTTPDRunning = false; m_httpListener2.ExceptionThrown -= httpServerException; - m_httpListener2.DisconnectHandler = null; + //m_httpListener2.DisconnectHandler = null; m_httpListener2.LogWriter = null; - m_httpListener2.RequestHandler -= OnHandleRequestIOThread; + m_httpListener2.RequestReceived -= OnRequest; m_httpListener2.Stop(); } diff --git a/OpenSim/Framework/Servers/Tests/OSHttpTests.cs b/OpenSim/Framework/Servers/Tests/OSHttpTests.cs index 48db44d..f7f0afa 100644 --- a/OpenSim/Framework/Servers/Tests/OSHttpTests.cs +++ b/OpenSim/Framework/Servers/Tests/OSHttpTests.cs @@ -46,6 +46,10 @@ namespace OpenSim.Framework.Servers.Tests public class TestHttpClientContext: IHttpClientContext { private bool _secured; + public bool IsSecured + { + get { return _secured; } + } public bool Secured { get { return _secured; } @@ -62,10 +66,19 @@ namespace OpenSim.Framework.Servers.Tests public void Respond(string body) {} public void Send(byte[] buffer) {} public void Send(byte[] buffer, int offset, int size) {} + public void Respond(string httpVersion, HttpStatusCode statusCode, string reason, string body, string contentType) {} + + public event EventHandler<DisconnectedEventArgs> Disconnected = delegate { }; + /// <summary> + /// A request have been received in the context. + /// </summary> + public event EventHandler<RequestEventArgs> RequestReceived = delegate { }; + } public class TestHttpRequest: IHttpRequest { + private string _uriPath; public bool BodyIsComplete { get { return true; } @@ -183,6 +196,24 @@ namespace OpenSim.Framework.Servers.Tests return clone; } + public IHttpResponse CreateResponse(IHttpClientContext context) + { + return new HttpResponse(context, this); + } + /// <summary> + /// Path and query (will be merged with the host header) and put in Uri + /// </summary> + /// <see cref="Uri"/> + public string UriPath + { + get { return _uriPath; } + set + { + _uriPath = value; + + } + } + } public class TestHttpResponse: IHttpResponse diff --git a/OpenSim/Region/UserStatistics/Default_Report.cs b/OpenSim/Region/UserStatistics/Default_Report.cs index 668fd45..0e17630 100644 --- a/OpenSim/Region/UserStatistics/Default_Report.cs +++ b/OpenSim/Region/UserStatistics/Default_Report.cs @@ -112,15 +112,15 @@ TD.align_top { vertical-align: top; } ajaxUpdaterDivs[0] = "activeconnections"; ajaxUpdaterSeconds[0] = 10; - ajaxUpdaterReportFragments[0] = "activeconnectionsajax.ajax"; + ajaxUpdaterReportFragments[0] = "activeconnectionsajax.html"; ajaxUpdaterDivs[1] = "activesimstats"; ajaxUpdaterSeconds[1] = 20; - ajaxUpdaterReportFragments[1] = "simstatsajax.ajax"; + ajaxUpdaterReportFragments[1] = "simstatsajax.html"; ajaxUpdaterDivs[2] = "activelog"; ajaxUpdaterSeconds[2] = 5; - ajaxUpdaterReportFragments[2] = "activelogajax.ajax"; + ajaxUpdaterReportFragments[2] = "activelogajax.html"; HTMLUtil.InsertPeriodicUpdaters(ref output, ajaxUpdaterDivs, ajaxUpdaterSeconds, ajaxUpdaterReportFragments); diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs index 0807607..a65b84c 100644 --- a/OpenSim/Region/UserStatistics/WebStatsModule.cs +++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs @@ -110,9 +110,9 @@ namespace OpenSim.Region.UserStatistics reports.Add("", rep); reports.Add("prototype.js", protodep); reports.Add("updater.js", updatedep); - reports.Add("activeconnectionsajax.ajax", ajConnections); - reports.Add("simstatsajax.ajax", ajSimStats); - reports.Add("activelogajax.ajax", ajLogLines); + reports.Add("activeconnectionsajax.html", ajConnections); + reports.Add("simstatsajax.html", ajSimStats); + reports.Add("activelogajax.html", ajLogLines); reports.Add("clients.report", clientReport); reports.Add("sessions.report", sessionsReport); diff --git a/ThirdPartyLicenses/C# Webserver.txt b/ThirdPartyLicenses/C# Webserver.txt index 40511b5..b996891 100644 --- a/ThirdPartyLicenses/C# Webserver.txt +++ b/ThirdPartyLicenses/C# Webserver.txt @@ -1,145 +1,71 @@ -Files: HttpServer.dll +Files: HttpServer_OpenSim.dll -Version 2.1, February 1999 +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ -Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] +1. Definitions. -Preamble +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. -The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. -This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. -When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. -To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. -For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. -We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). -To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. -Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." -Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. -When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. +2. Grant of Copyright License. -We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. -For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. +3. Grant of Patent License. -In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. -Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. +4. Redistribution. -The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +1. You must give any other recipients of the Work or Derivative Works a copy of this License; and -0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". +2. You must cause any modified files to carry prominent notices stating that You changed the files; and -A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. +3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and -The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) +4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. -"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. -Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. +5. Submission of Contributions. -1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. -You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. +6. Trademarks. -2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. -a) The modified work must itself be a software library. +7. Disclaimer of Warranty. -b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. -c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. +8. Limitation of Liability. -d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. -(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) +9. Accepting Warranty or Additional Liability. -These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. - -3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - -Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. - -This option is useful when you wish to copy part of the code of the Library into a program that is not a library. - -4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. - -If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. - -5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. - -However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. - -When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. - -If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) - -Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - -6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. - -You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: - -a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) - -b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. - -c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. - -d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. - -e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. - -For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. - -It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - -7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: - -a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. - -b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. - -8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. - -9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. - -10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. - -11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. - -This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - -12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. - -13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - -14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - -NO WARRANTY - -15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. \ No newline at end of file +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. \ No newline at end of file diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll index bc27835..77042a0 100644 Binary files a/bin/HttpServer_OpenSim.dll and b/bin/HttpServer_OpenSim.dll differ diff --git a/bin/HttpServer_OpenSim.pdb b/bin/HttpServer_OpenSim.pdb new file mode 100644 index 0000000..e3abbe2 Binary files /dev/null and b/bin/HttpServer_OpenSim.pdb differ diff --git a/bin/HttpServer_OpenSim.xml b/bin/HttpServer_OpenSim.xml index 747f35d..22cc1c0 100644 --- a/bin/HttpServer_OpenSim.xml +++ b/bin/HttpServer_OpenSim.xml @@ -4,1814 +4,1686 @@ <name>HttpServer_OpenSim</name> </assembly> <members> - <member name="T:HttpServer.ResponseCookies"> + <member name="T:HttpServer.Sessions.IHttpSession"> <summary> - Cookies that should be set. + Interface for sessions </summary> </member> - <member name="M:HttpServer.ResponseCookies.Add(HttpServer.ResponseCookie)"> + <member name="M:HttpServer.Sessions.IHttpSession.Clear"> <summary> - Adds a cookie in the collection. + Remove everything from the session </summary> - <param name="cookie">cookie to add</param> - <exception cref="T:System.ArgumentNullException">cookie is null</exception> </member> - <member name="M:HttpServer.ResponseCookies.Add(HttpServer.RequestCookie,System.DateTime)"> + <member name="M:HttpServer.Sessions.IHttpSession.Clear(System.Boolean)"> <summary> - Copy a request cookie + Remove everything from the session </summary> - <param name="cookie"></param> - <param name="expires">When the cookie should expire</param> + <param name="expires">True if the session is cleared due to expiration</param> </member> - <member name="M:HttpServer.ResponseCookies.GetEnumerator"> + <member name="P:HttpServer.Sessions.IHttpSession.Id"> <summary> - Gets a collection enumerator on the cookie list. + Session id </summary> - <returns>collection enumerator</returns> </member> - <member name="M:HttpServer.ResponseCookies.Clear"> + <member name="P:HttpServer.Sessions.IHttpSession.Item(System.String)"> <summary> - Remove all cookies + Should </summary> + <param name="name">Name of the session variable</param> + <returns>null if it's not set</returns> + <exception cref="T:System.Runtime.Serialization.SerializationException">If the object cant be serialized.</exception> </member> - <member name="M:HttpServer.ResponseCookies.System#Collections#Generic#IEnumerable{HttpServer#ResponseCookie}#GetEnumerator"> + <member name="P:HttpServer.Sessions.IHttpSession.Accessed"> <summary> - Returns an enumerator that iterates through the collection. + When the session was last accessed. + This property is touched by the http server each time the + session is requested. </summary> - - <returns> - A <see cref="T:System.Collections.Generic.IEnumerator`1"></see> that can be used to iterate through the collection. - </returns> - <filterpriority>1</filterpriority> </member> - <member name="P:HttpServer.ResponseCookies.Count"> + <member name="P:HttpServer.Sessions.IHttpSession.Count"> <summary> - Gets the count of cookies in the collection. + Number of session variables. </summary> </member> - <member name="P:HttpServer.ResponseCookies.Item(System.String)"> + <member name="E:HttpServer.Sessions.IHttpSession.BeforeClear"> <summary> - Gets the cookie of a given identifier (null if not existing). + Event triggered upon clearing the session </summary> </member> - <member name="T:HttpServer.Rendering.Haml.HamlGenerator"> + <member name="T:HttpServer.Sessions.HttpSessionClearedArgs"> <summary> - Generates C#/HTML from HAML code. + Arguments sent when a <see cref="T:HttpServer.Sessions.IHttpSession"/> is cleared </summary> - <remarks>HAML documentation: http://haml.hamptoncatlin.com/docs/rdoc/classes/Haml.html</remarks> </member> - <member name="T:HttpServer.Rendering.ITemplateGenerator"> + <member name="M:HttpServer.Sessions.HttpSessionClearedArgs.#ctor(System.Boolean)"> <summary> - A code generator is used to convert template code to something that we can - work with, as HTML or c# code. + Instantiates the arguments for the event </summary> - <seealso cref="T:HttpServer.Rendering.TemplateManager"/> + <param name="expired">True if the session is cleared due to expiration</param> </member> - <member name="M:HttpServer.Rendering.ITemplateGenerator.GenerateCode(System.IO.TextWriter)"> + <member name="P:HttpServer.Sessions.HttpSessionClearedArgs.Expired"> <summary> - Generate C# code from the template. + Returns true if the session is cleared due to expiration </summary> - <param name="writer">A <see cref="T:System.IO.TextWriter"/> that the generated code will be written to.</param> - <exception cref="T:System.InvalidOperationException">If the template have not been parsed first.</exception> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException">If template is incorrect</exception> </member> - <member name="M:HttpServer.Rendering.ITemplateGenerator.Parse(System.String)"> + <member name="T:HttpServer.Sessions.HttpSessionClearedHandler"> <summary> - Parse a file and convert into to our own template object code. + Delegate for when a IHttpSession is cleared </summary> - <param name="fullPath">Path and filename to a template</param> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException">If something is incorrect in the template.</exception> - <exception cref="T:System.IO.FileNotFoundException"></exception> - <exception cref="T:System.IO.DirectoryNotFoundException"></exception> - <exception cref="T:System.UnauthorizedAccessException"></exception> - <exception cref="T:System.IO.PathTooLongException"></exception> - <exception cref="T:System.NotSupportedException"></exception> + <param name="session"><see cref="T:HttpServer.Sessions.IHttpSession"/> this is being cleared.</param> + <param name="args">Arguments for the clearing</param> </member> - <member name="M:HttpServer.Rendering.ITemplateGenerator.Parse(System.IO.TextReader)"> + <member name="T:HttpServer.HttpListenerBase"> <summary> - Parse a file and convert into to our own template object code. + Contains a listener that doesn't do anything with the connections. </summary> - <param name="reader">A <see cref="T:System.IO.TextReader"/> containing our template</param> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException">If something is incorrect in the template.</exception> </member> - <member name="M:HttpServer.Rendering.Haml.HamlGenerator.#ctor"> + <member name="M:HttpServer.HttpListenerBase.#ctor(System.Net.IPAddress,System.Int32,HttpServer.IHttpContextFactory)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Rendering.Haml.HamlGenerator"/> class. + Listen for regular HTTP connections </summary> + <param name="address">IP Address to accept connections on</param> + <param name="port">TCP Port to listen on, default HTTP port is 80.</param> + <param name="factory">Factory used to create <see cref="T:HttpServer.IHttpClientContext"/>es.</param> + <exception cref="T:System.ArgumentNullException"><c>address</c> is null.</exception> + <exception cref="T:System.ArgumentException">Port must be a positive number.</exception> </member> - <member name="M:HttpServer.Rendering.Haml.HamlGenerator.#ctor(HttpServer.ILogWriter)"> + <member name="M:HttpServer.HttpListenerBase.#ctor(System.Net.IPAddress,System.Int32,HttpServer.IHttpContextFactory,System.Security.Cryptography.X509Certificates.X509Certificate)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Rendering.Haml.HamlGenerator"/> class. + Initializes a new instance of the <see cref="T:HttpServer.HttpListenerBase"/> class. </summary> - <param name="logWriter">The log writer.</param> + <param name="address">IP Address to accept connections on</param> + <param name="port">TCP Port to listen on, default HTTPS port is 443</param> + <param name="factory">Factory used to create <see cref="T:HttpServer.IHttpClientContext"/>es.</param> + <param name="certificate">Certificate to use</param> </member> - <member name="M:HttpServer.Rendering.Haml.HamlGenerator.CheckIntendation(HttpServer.Rendering.Haml.LineInfo,System.Int32@,System.Int32@)"> + <member name="M:HttpServer.HttpListenerBase.#ctor(System.Net.IPAddress,System.Int32,HttpServer.IHttpContextFactory,System.Security.Cryptography.X509Certificates.X509Certificate,System.Security.Authentication.SslProtocols)"> <summary> - Check and validate indentation + Initializes a new instance of the <see cref="T:HttpServer.HttpListenerBase"/> class. </summary> - <param name="line">line to check</param> - <param name="ws">number of white spaces</param> - <param name="intendation">number of indentations (2 white spaces = 1 intend, 1 tab = 1 intend)</param> + <param name="address">IP Address to accept connections on</param> + <param name="port">TCP Port to listen on, default HTTPS port is 443</param> + <param name="factory">Factory used to create <see cref="T:HttpServer.IHttpClientContext"/>es.</param> + <param name="certificate">Certificate to use</param> + <param name="protocol">which HTTPS protocol to use, default is TLS.</param> </member> - <member name="M:HttpServer.Rendering.Haml.HamlGenerator.CheckIntendation(HttpServer.Rendering.Haml.LineInfo)"> + <member name="M:HttpServer.HttpListenerBase.OnAccept(System.IAsyncResult)"> + <exception cref="T:System.Exception"><c>Exception</c>.</exception> + </member> + <member name="M:HttpServer.HttpListenerBase.RetryBeginAccept"> <summary> - Check indentation + Will try to accept connections one more time. </summary> - <param name="line">fills line with intend info</param> + <exception cref="T:System.Exception">If any exceptions is thrown.</exception> </member> - <member name="M:HttpServer.Rendering.Haml.HamlGenerator.CheckMultiLine(HttpServer.Rendering.Haml.LineInfo,HttpServer.Rendering.Haml.LineInfo)"> + <member name="M:HttpServer.HttpListenerBase.OnAcceptingSocket(System.Net.Sockets.Socket)"> <summary> - check if current line is a multi line + Can be used to create filtering of new connections. </summary> - <param name="prevLine">previous line</param> - <param name="line">current line</param> + <param name="socket">Accepted socket</param> + <returns>true if connection can be accepted; otherwise false.</returns> </member> - <member name="M:HttpServer.Rendering.Haml.HamlGenerator.GenerateHtml(System.IO.TextWriter)"> + <member name="M:HttpServer.HttpListenerBase.Start(System.Int32)"> <summary> - Generate HTML code from the template. - Code is encapsulated in <% and <%= + Start listen for new connections </summary> - <param name="writer">A <see cref="T:System.IO.TextWriter"/> that the generated code will be written to.</param> - <exception cref="T:System.InvalidOperationException">If the template have not been parsed first.</exception> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException">If template is incorrect</exception> + <param name="backlog">Number of connections that can stand in a queue to be accepted.</param> + <exception cref="T:System.InvalidOperationException">Listener have already been started.</exception> </member> - <member name="M:HttpServer.Rendering.Haml.HamlGenerator.GetWord(System.String,System.Int32)"> + <member name="M:HttpServer.HttpListenerBase.Stop"> <summary> - Get the first word (letters and digits only) from the specified offset. + Stop the listener </summary> - <param name="data"></param> - <param name="offset"></param> - <returns></returns> + <exception cref="T:System.Net.Sockets.SocketException"></exception> </member> - <member name="M:HttpServer.Rendering.Haml.HamlGenerator.HandlePlacement"> + <member name="P:HttpServer.HttpListenerBase.LogWriter"> <summary> - Check indentation / node placement + Gives you a change to receive log entries for all internals of the HTTP library. </summary> + <remarks> + You may not switch log writer after starting the listener. + </remarks> </member> - <member name="M:HttpServer.Rendering.Haml.HamlGenerator.ParseNode(HttpServer.Rendering.Haml.LineInfo,HttpServer.Rendering.Haml.NodeList,HttpServer.Rendering.Haml.Nodes.Node,HttpServer.Rendering.Haml.Nodes.TextNode)"> + <member name="P:HttpServer.HttpListenerBase.UseTraceLogs"> <summary> - Parse a node - todo: improve doc + True if we should turn on trace logs. </summary> - <param name="theLine"></param> - <param name="prototypes"></param> - <param name="parent"></param> - <param name="textNode"></param> </member> - <member name="M:HttpServer.Rendering.Haml.HamlGenerator.PreParse(System.IO.TextReader)"> + <member name="E:HttpServer.HttpListenerBase.ExceptionThrown"> <summary> - PreParse goes through the text add handles indentation - and all multi line cases. + Catch exceptions not handled by the listener. </summary> - <param name="reader">Reader containing the text</param> + <remarks> + Exceptions will be thrown during debug mode if this event is not used, + exceptions will be printed to console and suppressed during release mode. + </remarks> </member> - <member name="M:HttpServer.Rendering.Haml.HamlGenerator.PrintDocument"> + <member name="E:HttpServer.HttpListenerBase.RequestReceived"> <summary> - print the entire document + A request have been received from a <see cref="T:HttpServer.IHttpClientContext"/>. </summary> </member> - <member name="M:HttpServer.Rendering.Haml.HamlGenerator.PrintNode(HttpServer.Rendering.Haml.LineInfo)"> + <member name="T:HttpServer.Exceptions.InternalServerException"> <summary> - Print line information to the console + The server encountered an unexpected condition which prevented it from fulfilling the request. </summary> - <param name="line"></param> </member> - <member name="M:HttpServer.Rendering.Haml.HamlGenerator.ReadLine"> + <member name="T:HttpServer.Exceptions.HttpException"> <summary> - Read next line from file + All HTTP based exceptions will derive this class. </summary> - <returns>true if line could be read; false if EOF.</returns> </member> - <member name="M:HttpServer.Rendering.Haml.HamlGenerator.Spaces(System.Int32)"> + <member name="M:HttpServer.Exceptions.HttpException.#ctor(System.Net.HttpStatusCode,System.String)"> <summary> - Generates a string with spaces. + Create a new HttpException </summary> - <param name="count">number of spaces.</param> - <returns>string of spaces.</returns> + <param name="code">http status code (sent in the response)</param> + <param name="message">error description</param> </member> - <member name="M:HttpServer.Rendering.Haml.HamlGenerator.Parse(System.String)"> + <member name="M:HttpServer.Exceptions.HttpException.#ctor(System.Net.HttpStatusCode,System.String,System.Exception)"> <summary> - Parse a file and convert into to our own template object code. + Create a new HttpException </summary> - <param name="fullPath">Path and filename to a template</param> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException">If something is incorrect in the template.</exception> - <exception cref="T:System.IO.FileNotFoundException"></exception> - <exception cref="T:System.IO.DirectoryNotFoundException"></exception> - <exception cref="T:System.UnauthorizedAccessException"></exception> - <exception cref="T:System.IO.PathTooLongException"></exception> - <exception cref="T:System.NotSupportedException"></exception> - <exception cref="T:System.ArgumentException"></exception> + <param name="code">http status code (sent in the response)</param> + <param name="message">error description</param> + <param name="inner">inner exception</param> </member> - <member name="M:HttpServer.Rendering.Haml.HamlGenerator.Parse(System.IO.TextReader)"> + <member name="P:HttpServer.Exceptions.HttpException.HttpStatusCode"> <summary> - Parse a file and convert into to our own template object code. + status code to use in the response. </summary> - <param name="reader">A <see cref="T:System.IO.TextReader"/> containing our template</param> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException">If something is incorrect in the template.</exception> </member> - <member name="M:HttpServer.Rendering.Haml.HamlGenerator.GenerateCode(System.IO.TextWriter)"> + <member name="M:HttpServer.Exceptions.InternalServerException.#ctor"> <summary> - Generate C# code from the template. + Initializes a new instance of the <see cref="T:HttpServer.Exceptions.InternalServerException"/> class. </summary> - <param name="writer">A <see cref="T:System.IO.TextWriter"/> that the generated code will be written to.</param> - <exception cref="T:System.InvalidOperationException">If the template have not been parsed first.</exception> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException">If template is incorrect</exception> </member> - <member name="P:HttpServer.Rendering.Haml.HamlGenerator.RootNode"> + <member name="M:HttpServer.Exceptions.InternalServerException.#ctor(System.String)"> <summary> - Property to retrieve the root node for the latest parsed document + Initializes a new instance of the <see cref="T:HttpServer.Exceptions.InternalServerException"/> class. </summary> + <param name="message">error message.</param> </member> - <member name="T:HttpServer.Rules.RegexRedirectRule"> + <member name="M:HttpServer.Exceptions.InternalServerException.#ctor(System.String,System.Exception)"> <summary> - Class to make dynamic binding of redirects. Instead of having to specify a number of similar redirect rules - a regular expression can be used to identify redirect urls and thier targets. + Initializes a new instance of the <see cref="T:HttpServer.Exceptions.InternalServerException"/> class. </summary> - <example> - <![CDATA[ - new RegexRedirectRule("/(?<target>[a-z0-9]+)", "/users/${target}?find=true", RegexOptions.IgnoreCase) - ]]> - </example> + <param name="message">error message.</param> + <param name="inner">inner exception.</param> </member> - <member name="T:HttpServer.Rules.RedirectRule"> + <member name="T:HttpServer.HttpModules.HttpModuleExceptionEventArgs"> <summary> - redirects from one url to another. + Used to inform http server that </summary> </member> - <member name="T:HttpServer.Rules.IRule"> + <member name="M:HttpServer.HttpModules.HttpModuleExceptionEventArgs.#ctor(System.Exception)"> <summary> - Rules are used to perform operations before a request is being handled. - Rules can be used to create routing etc. + Eventarguments used when an exception is thrown by a module </summary> + <param name="e">the exception</param> </member> - <member name="M:HttpServer.Rules.IRule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse)"> + <member name="P:HttpServer.HttpModules.HttpModuleExceptionEventArgs.Exception"> <summary> - Process the incoming request. + Exception thrown in a module </summary> - <param name="request">incoming http request</param> - <param name="response">outgoing http response</param> - <returns>true if response should be sent to the browser directly (no other rules or modules will be processed).</returns> - <remarks> - returning true means that no modules will get the request. Returning true is typically being done - for redirects. - </remarks> - <exception cref="T:System.ArgumentNullException">If request or response is null.</exception> </member> - <member name="M:HttpServer.Rules.RedirectRule.#ctor(System.String,System.String)"> + <member name="T:HttpServer.Helpers.ResourceInfo"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Rules.RedirectRule"/> class. + Container to bind resource names to assemblies </summary> - <param name="fromUrl">Absolute path (no servername)</param> - <param name="toUrl">Absolute path (no servername)</param> - <example> - server.Add(new RedirectRule("/", "/user/index")); - </example> </member> - <member name="M:HttpServer.Rules.RedirectRule.#ctor(System.String,System.String,System.Boolean)"> + <member name="M:HttpServer.Helpers.ResourceInfo.#ctor(System.String,System.String,System.Reflection.Assembly)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Rules.RedirectRule"/> class. + Instantiates an instance of <see cref="T:HttpServer.Helpers.ResourceInfo"/> </summary> - <param name="fromUrl">Absolute path (no servername)</param> - <param name="toUrl">Absolute path (no servername)</param> - <param name="shouldRedirect">true if request should be redirected, false if the request uri should be replaced.</param> - <example> - server.Add(new RedirectRule("/", "/user/index")); - </example> + <param name="uri">The dot seperated uri the resource maps to</param> + <param name="resourceName">The full resource name</param> + <param name="assembly">The assembly the resource exists in</param> </member> - <member name="M:HttpServer.Rules.RedirectRule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse)"> + <member name="M:HttpServer.Helpers.ResourceInfo.GetStream"> <summary> - Process the incoming request. + Retrieves a stream to the resource </summary> - <param name="request">incoming http request</param> - <param name="response">outgoing http response</param> - <returns>true if response should be sent to the browser directly (no other rules or modules will be processed).</returns> - <remarks> - returning true means that no modules will get the request. Returning true is typically being done - for redirects. - </remarks> + <returns>Null if the resource couldn't be located somehow</returns> </member> - <member name="P:HttpServer.Rules.RedirectRule.FromUrl"> + <member name="P:HttpServer.Helpers.ResourceInfo.Assembly"> <summary> - string to match request url with. + Retrieves the assembly the resource resides in </summary> - <remarks>Is compared to request.Uri.AbsolutePath</remarks> </member> - <member name="P:HttpServer.Rules.RedirectRule.ToUrl"> + <member name="P:HttpServer.Helpers.ResourceInfo.Uri"> <summary> - Where to redirect. + Retrieves the full name/path of the assembly </summary> </member> - <member name="P:HttpServer.Rules.RedirectRule.ShouldRedirect"> + <member name="P:HttpServer.Helpers.ResourceInfo.Extension"> <summary> - true if we should redirect. + Retrieves the extension of the resource </summary> - <remarks> - false means that the rule will replace - the current request uri with the new one from this class. - </remarks> </member> - <member name="M:HttpServer.Rules.RegexRedirectRule.#ctor(System.String,System.String)"> + <member name="P:HttpServer.Helpers.ResourceInfo.ExtensionLessUri"> + <summary>Returns the Uri without extension</summary> + </member> + <member name="P:HttpServer.Helpers.ResourceInfo.ResourceName"> + <summary>Retrieves the full path name to the resource file</summary> + </member> + <member name="M:HttpServer.FormDecoders.HttpMultipart.ReadLine"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Rules.RegexRedirectRule"/> class. + </summary> - <param name="fromUrlExpression">Expression to match url</param> - <param name="toUrlExpression">Expression to generate url</param> - <example> - <![CDATA[ - server.Add(new RegexRedirectRule("/(?<first>[a-zA-Z0-9]+)", "/user/${first}")); - Result of ie. /employee1 will then be /user/employee1 - ]]> - </example> + <returns></returns> + <exception cref="T:System.ArgumentOutOfRangeException"></exception> + <exception cref="T:System.ObjectDisposedException"></exception> </member> - <member name="M:HttpServer.Rules.RegexRedirectRule.#ctor(System.String,System.String,System.Text.RegularExpressions.RegexOptions)"> + <member name="T:HttpServer.FormDecoders.HttpMultipart.Element"> + <summary>Represents a field in a multipart form</summary> + </member> + <member name="T:HttpServer.Parser.HeaderEventArgs"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Rules.RegexRedirectRule"/> class. + Event arguments used when a new header have been parsed. </summary> - <param name="fromUrlExpression">Expression to match url</param> - <param name="toUrlExpression">Expression to generate url</param> - <param name="options">Regular expression options to use, can be null</param> - <example> - <![CDATA[ - server.Add(new RegexRedirectRule("/(?<first>[a-zA-Z0-9]+)", "/user/{first}", RegexOptions.IgnoreCase)); - Result of ie. /employee1 will then be /user/employee1 - ]]> - </example> </member> - <member name="M:HttpServer.Rules.RegexRedirectRule.#ctor(System.String,System.String,System.Text.RegularExpressions.RegexOptions,System.Boolean)"> + <member name="M:HttpServer.Parser.HeaderEventArgs.#ctor(System.String,System.String)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Rules.RegexRedirectRule"/> class. + Initializes a new instance of the <see cref="T:HttpServer.Parser.HeaderEventArgs"/> class. </summary> - <param name="fromUrlExpression">Expression to match url</param> - <param name="toUrlExpression">Expression to generate url</param> - <param name="options">Regular expression options to apply</param> - <param name="shouldRedirect">true if request should be redirected, false if the request uri should be replaced.</param> - <example> - <![CDATA[ - server.Add(new RegexRedirectRule("/(?<first>[a-zA-Z0-9]+)", "/user/${first}", RegexOptions.None)); - Result of ie. /employee1 will then be /user/employee1 - ]]> - </example> + <param name="name">Name of header.</param> + <param name="value">Header value.</param> </member> - <member name="M:HttpServer.Rules.RegexRedirectRule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse)"> + <member name="M:HttpServer.Parser.HeaderEventArgs.#ctor"> <summary> - Process the incoming request. + Initializes a new instance of the <see cref="T:HttpServer.Parser.HeaderEventArgs"/> class. </summary> - <param name="request">incoming http request</param> - <param name="response">outgoing http response</param> - <returns>true if response should be sent to the browser directly (no other rules or modules will be processed).</returns> - <remarks> - returning true means that no modules will get the request. Returning true is typically being done - for redirects. - </remarks> - <exception cref="T:System.ArgumentNullException">If request or response is null</exception> </member> - <member name="T:HttpServer.Rendering.ITemplateLoader"> + <member name="P:HttpServer.Parser.HeaderEventArgs.Name"> <summary> - Interface used to load templates from different sources. + Gets or sets header name. </summary> </member> - <member name="M:HttpServer.Rendering.ITemplateLoader.LoadTemplate(System.String)"> + <member name="P:HttpServer.Parser.HeaderEventArgs.Value"> <summary> - Load a template into a <see cref="T:System.IO.TextReader"/> and return it. + Gets or sets header value. </summary> - <param name="path">Relative path (and filename) to template.</param> - <returns>a <see cref="T:System.IO.TextReader"/> if file was found; otherwise null.</returns> </member> - <member name="M:HttpServer.Rendering.ITemplateLoader.GetFiles(System.String,System.String)"> + <member name="T:HttpServer.HttpListener"> <summary> - Fetch all files from the resource that matches the specified arguments. + New implementation of the HTTP listener. </summary> - <param name="path">Where the file should reside.</param> - <param name="filename">Files to check</param> - <returns>a list of files if found; or an empty array if no files are found.</returns> + <remarks> + Use the <c>Create</c> methods to create a default listener. + </remarks> </member> - <member name="M:HttpServer.Rendering.ITemplateLoader.CheckTemplate(HttpServer.Rendering.ITemplateInfo)"> + <member name="M:HttpServer.HttpListener.#ctor(System.Net.IPAddress,System.Int32,HttpServer.IHttpContextFactory)"> <summary> - Check's whether a template should be reloaded or not. + Initializes a new instance of the <see cref="T:HttpServer.HttpListener"/> class. </summary> - <param name="info">template information</param> - <returns>true if template is OK; false if it do not exist or are old.</returns> + <param name="address">IP Address to accept connections on</param> + <param name="port">TCP Port to listen on, default HTTP port is 80.</param> + <param name="factory">Factory used to create <see cref="T:HttpServer.IHttpClientContext"/>es.</param> + <exception cref="T:System.ArgumentNullException"><c>address</c> is null.</exception> + <exception cref="T:System.ArgumentException">Port must be a positive number.</exception> </member> - <member name="M:HttpServer.Rendering.ITemplateLoader.HasTemplate(System.String)"> + <member name="M:HttpServer.HttpListener.#ctor(System.Net.IPAddress,System.Int32,HttpServer.IHttpContextFactory,System.Security.Cryptography.X509Certificates.X509Certificate)"> <summary> - Returns whether or not the loader has an instance of the file requested + Initializes a new instance of the <see cref="T:HttpServer.HttpListener"/> class. </summary> - <param name="filename">The name of the template/file</param> - <returns>True if the loader can provide the file</returns> + <param name="address">The address.</param> + <param name="port">The port.</param> + <param name="factory">The factory.</param> + <param name="certificate">The certificate.</param> </member> - <member name="T:HttpServer.Helpers.WebHelper"> + <member name="M:HttpServer.HttpListener.#ctor(System.Net.IPAddress,System.Int32,HttpServer.IHttpContextFactory,System.Security.Cryptography.X509Certificates.X509Certificate,System.Security.Authentication.SslProtocols)"> <summary> - Webhelper provides helpers for common tasks in HTML. + Initializes a new instance of the <see cref="T:HttpServer.HttpListener"/> class. </summary> + <param name="address">The address.</param> + <param name="port">The port.</param> + <param name="factory">The factory.</param> + <param name="certificate">The certificate.</param> + <param name="protocol">The protocol.</param> </member> - <member name="F:HttpServer.Helpers.WebHelper.JSImplementation"> + <member name="M:HttpServer.HttpListener.Create(System.Net.IPAddress,System.Int32)"> <summary> - Used to let the website use different javascript libraries. - Default is <see cref="T:HttpServer.Helpers.Implementations.PrototypeImp"/> + Creates a new <see cref="T:HttpServer.HttpListener"/> instance with default factories. </summary> + <param name="address">Address that the listener should accept connections on.</param> + <param name="port">Port that listener should accept connections on.</param> + <returns>Created HTTP listener.</returns> </member> - <member name="M:HttpServer.Helpers.WebHelper.AjaxRequest(System.String,System.String,System.String[])"> + <member name="M:HttpServer.HttpListener.Create(System.Net.IPAddress,System.Int32,System.Security.Cryptography.X509Certificates.X509Certificate)"> <summary> - Creates a link that invokes through ajax. + Creates a new <see cref="T:HttpServer.HttpListener"/> instance with default factories. </summary> - <param name="url">url to fetch</param> - <param name="title">link title</param> - <param name="options"> - optional options in format "key, value, key, value". - Javascript options starts with ':'. - </param> - <returns>a link tag</returns> - <example> - WebHelper.AjaxRequest("/users/add/", "Add user", "method:", "post", "onclick", "validate('this');"); - </example> + <param name="address">Address that the listener should accept connections on.</param> + <param name="port">Port that listener should accept connections on.</param> + <param name="certificate">Certificate to use</param> + <returns>Created HTTP listener.</returns> </member> - <member name="M:HttpServer.Helpers.WebHelper.AjaxUpdater(System.String,System.String,System.String,System.String[])"> + <member name="M:HttpServer.HttpListener.Create(System.Net.IPAddress,System.Int32,System.Security.Cryptography.X509Certificates.X509Certificate,System.Security.Authentication.SslProtocols)"> <summary> - Builds a link that updates an element with the fetched ajax content. + Creates a new <see cref="T:HttpServer.HttpListener"/> instance with default factories. </summary> - <param name="url">Url to fetch content from</param> - <param name="title">link title</param> - <param name="targetId">html element to update with the results of the ajax request.</param> - <param name="options">optional options in format "key, value, key, value"</param> - <returns>A link tag.</returns> + <param name="address">Address that the listener should accept connections on.</param> + <param name="port">Port that listener should accept connections on.</param> + <param name="certificate">Certificate to use</param> + <param name="protocol">which HTTPS protocol to use, default is TLS.</param> + <returns>Created HTTP listener.</returns> </member> - <member name="M:HttpServer.Helpers.WebHelper.DialogLink(System.String,System.String,System.String[])"> + <member name="M:HttpServer.HttpListener.OnAcceptingSocket(System.Net.Sockets.Socket)"> <summary> - A link that pop ups a Dialog (overlay div) + Can be used to create filtering of new connections. </summary> - <param name="url">url to contents of dialog</param> - <param name="title">link title</param> - <param name="htmlAttributes">name/value of html attributes.</param> - <returns>A "a"-tag that popups a dialog when clicked</returns> - <example> - WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); - </example> - </member> - <member name="M:HttpServer.Helpers.WebHelper.CreateDialog(System.String,System.String,System.String[])"> - <summary> - Create/Open a dialog box using ajax - </summary> - <param name="url"></param> - <param name="title"></param> - <param name="parameters"></param> - <returns></returns> + <param name="socket">Accepted socket</param> + <returns> + true if connection can be accepted; otherwise false. + </returns> </member> - <member name="M:HttpServer.Helpers.WebHelper.CloseDialog"> + <member name="E:HttpServer.HttpListener.Accepted"> <summary> - Close a javascript dialog window/div. + A client have been accepted, but not handled, by the listener. </summary> - <returns>javascript for closing a dialog.</returns> - <see cref="M:HttpServer.Helpers.WebHelper.DialogLink(System.String,System.String,System.String[])"/> </member> - <member name="M:HttpServer.Helpers.WebHelper.FormStart(System.String,System.String,System.Boolean)"> + <member name="T:HttpServer.FormDecoders.XmlDecoder"> <summary> - Create a <form> tag. + This decoder converts XML documents to form items. + Each element becomes a subitem in the form, and each attribute becomes an item. </summary> - <param name="name">name of form</param> - <param name="action">action to invoke on submit</param> - <param name="isAjax">form should be posted as ajax</param> - <returns>html code</returns> <example> - WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax); + // xml: <hello id="1">something<world id="2">data</world></hello> + // result: + // form["hello"].Value = "something" + // form["hello"]["id"].Value = 1 + // form["hello"]["world]["id"].Value = 1 + // form["hello"]["world"].Value = "data" </example> + <remarks> + The original xml document is stored in form["__xml__"].Value. + </remarks> </member> - <member name="M:HttpServer.Helpers.WebHelper.Link(System.String,System.String,System.String[])"> + <member name="T:HttpServer.FormDecoders.IFormDecoder"> <summary> - Create a link tag. + Interface for form content decoders. </summary> - <param name="url">url to go to</param> - <param name="title">link title (text that is displayed)</param> - <param name="htmlAttributes">html attributes, name, value, name, value</param> - <returns>html code</returns> - <example> - WebHelper.Link("/user/show/1", "Show user", "id", "showUser", "onclick", "return confirm('Are you shure?');"); - </example> </member> - <member name="M:HttpServer.Helpers.WebHelper.BuildLink(System.String,System.String,System.String[])"> + <member name="M:HttpServer.FormDecoders.IFormDecoder.Decode(System.IO.Stream,System.String,System.Text.Encoding)"> <summary> - Build a link + </summary> - <param name="url">url to go to.</param> - <param name="title">title of link (displayed text)</param> - <param name="htmlAttributes">extra html attributes.</param> - <returns>a complete link</returns> + <param name="stream">Stream containing the content</param> + <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case</param> + <param name="encoding">Stream enconding</param> + <returns>A http form, or null if content could not be parsed.</returns> + <exception cref="T:System.IO.InvalidDataException">If contents in the stream is not valid input data.</exception> </member> - <member name="M:HttpServer.Helpers.WebHelper.BuildLink(System.String,System.String,System.String[],System.String[])"> + <member name="M:HttpServer.FormDecoders.IFormDecoder.CanParse(System.String)"> <summary> - Build a link + Checks if the decoder can handle the mime type </summary> - <param name="url">url to go to.</param> - <param name="title">title of link (displayed text)</param> - <param name="htmlAttributes">extra html attributes.</param> - <returns>a complete link</returns> - <param name="options">more options</param> + <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case.</param> + <returns>True if the decoder can parse the specified content type</returns> </member> - <member name="M:HttpServer.Helpers.WebHelper.Select(System.String,System.Collections.ICollection,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"> + <member name="M:HttpServer.FormDecoders.XmlDecoder.Decode(System.IO.Stream,System.String,System.Text.Encoding)"> <summary> - Obsolete + </summary> - <param name="name">Obsolete</param> - <param name="collection">Obsolete</param> - <param name="getIdTitle">Obsolete</param> - <param name="selectedValue">Obsolete</param> - <param name="firstEmpty">Obsolete</param> - <returns>Obsolete</returns> + <param name="stream">Stream containing the content</param> + <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case</param> + <param name="encoding">Stream encoding</param> + Note: contentType and encoding are not used? + <returns>A http form, or null if content could not be parsed.</returns> + <exception cref="T:System.IO.InvalidDataException"></exception> </member> - <member name="M:HttpServer.Helpers.WebHelper.Select(System.String,System.String,System.Collections.ICollection,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"> + <member name="M:HttpServer.FormDecoders.XmlDecoder.TraverseNode(HttpServer.IHttpInput,System.Xml.XmlNode)"> <summary> - Obsolete + Recursive function that will go through an xml element and store it's content + to the form item. </summary> - <param name="name">Obsolete</param> - <param name="id">Obsolete</param> - <param name="collection">Obsolete</param> - <param name="getIdTitle">Obsolete</param> - <param name="selectedValue">Obsolete</param> - <param name="firstEmpty">Obsolete</param> - <returns>Obsolete</returns> + <param name="item">(parent) Item in form that content should be added to.</param> + <param name="node">Node that should be parsed.</param> </member> - <member name="M:HttpServer.Helpers.WebHelper.List(System.Collections.Generic.IEnumerable{System.Object},System.String)"> + <member name="M:HttpServer.FormDecoders.XmlDecoder.CanParse(System.String)"> <summary> - Render errors into a UL with class "errors" + Checks if the decoder can handle the mime type </summary> - <param name="className">class used by UL-tag.</param> - <param name="theList">items to list</param> - <returns>an unordered html list.</returns> + <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case.</param> + <returns>True if the decoder can parse the specified content type</returns> </member> - <member name="M:HttpServer.Helpers.WebHelper.List(System.Collections.Specialized.NameValueCollection,System.String)"> + <member name="T:HttpServer.ExceptionHandler"> <summary> - Render errors into a UL with class "errors" + We dont want to let the server to die due to exceptions thrown in worker threads. + therefore we use this delegate to give you a change to handle uncaught exceptions. </summary> - <param name="className">class used by UL-tag.</param> - <param name="theList">items to list</param> - <returns>an unordered html list.</returns> + <param name="source">Class that the exception was thrown in.</param> + <param name="exception">Exception</param> + <remarks> + Server will throw a InternalServerException in release version if you dont + handle this delegate. + </remarks> </member> - <member name="M:HttpServer.Helpers.WebHelper.Errors(System.Collections.Specialized.NameValueCollection)"> + <member name="T:HttpServer.Authentication.DigestAuthentication"> <summary> - Render errors into a UL with class "errors" + Implements HTTP Digest authentication. It's more secure than Basic auth since password is + encrypted with a "key" from the server. </summary> - <param name="errors"></param> - <returns></returns> + <remarks> + Keep in mind that the password is encrypted with MD5. Use a combination of SSL and digest auth to be secure. + </remarks> </member> - <member name="M:HttpServer.Helpers.WebHelper.GenerateHtmlAttributes(System.Text.StringBuilder,System.String[],System.String[])"> + <member name="T:HttpServer.Authentication.AuthenticationModule"> <summary> - Generates a list with html attributes. + Authentication modules are used to implement different + kind of HTTP authentication. </summary> - <param name="sb">StringBuilder that the options should be added to.</param> - <param name="firstOptions">attributes set by user.</param> - <param name="secondOptions">attributes set by any of the helper classes.</param> </member> - <member name="M:HttpServer.Helpers.WebHelper.GenerateHtmlAttributes(System.Text.StringBuilder,System.String[])"> + <member name="F:HttpServer.Authentication.AuthenticationModule.AuthenticationTag"> <summary> - Generates a list with html attributes. + Tag used for authentication. </summary> - <param name="sb">StringBuilder that the options should be added to.</param> - <param name="options"></param> </member> - <member name="T:HttpServer.Helpers.JavascriptHelperImplementation"> + <member name="M:HttpServer.Authentication.AuthenticationModule.#ctor(HttpServer.Authentication.AuthenticationHandler,HttpServer.Authentication.AuthenticationRequiredHandler)"> <summary> - Purpose of this class is to create a javascript toolkit independent javascript helper. + Initializes a new instance of the <see cref="T:HttpServer.Authentication.AuthenticationModule"/> class. </summary> + <param name="authenticator">Delegate used to provide information used during authentication.</param> + <param name="authenticationRequiredHandler">Delegate used to determine if authentication is required (may be null).</param> </member> - <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.GenerateOptions(System.Text.StringBuilder,System.String[],System.Boolean)"> + <member name="M:HttpServer.Authentication.AuthenticationModule.#ctor(HttpServer.Authentication.AuthenticationHandler)"> <summary> - Generates a list with JS options. + Initializes a new instance of the <see cref="T:HttpServer.Authentication.AuthenticationModule"/> class. </summary> - <param name="sb">StringBuilder that the options should be added to.</param> - <param name="options">the javascript options. name, value pairs. each string value should be escaped by YOU!</param> - <param name="startWithComma">true if we should start with a comma.</param> + <param name="authenticator">Delegate used to provide information used during authentication.</param> </member> - <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.RemoveJavascriptOptions(System.String[])"> + <member name="M:HttpServer.Authentication.AuthenticationModule.CreateResponse(System.String,System.Object[])"> <summary> - Removes any javascript parameters from an array of parameters + Create a response that can be sent in the WWW-Authenticate header. </summary> - <param name="options">The array of parameters to remove javascript params from</param> - <returns>An array of html parameters</returns> + <param name="realm">Realm that the user should authenticate in</param> + <param name="options">Array with optional options.</param> + <returns>A correct authentication request.</returns> + <exception cref="T:System.ArgumentNullException">If realm is empty or null.</exception> </member> - <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.AjaxFormOnSubmit(System.String[])"> + <member name="M:HttpServer.Authentication.AuthenticationModule.Authenticate(System.String,System.String,System.String,System.Object[])"> <summary> - javascript action that should be added to the "onsubmit" event in the form tag. + An authentication response have been received from the web browser. + Check if it's correct </summary> - <returns></returns> - <remarks>All javascript option names should end with colon.</remarks> - <example> - <code> - JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); - </code> - </example> + <param name="authenticationHeader">Contents from the Authorization header</param> + <param name="realm">Realm that should be authenticated</param> + <param name="httpVerb">GET/POST/PUT/DELETE etc.</param> + <param name="options">options to specific implementations</param> + <returns>Authentication object that is stored for the request. A user class or something like that.</returns> + <exception cref="T:System.ArgumentException">if <paramref name="authenticationHeader"/> is invalid</exception> + <exception cref="T:System.ArgumentNullException">If any of the parameters is empty or null.</exception> </member> - <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.AjaxRequest(System.String,System.String[])"> + <member name="M:HttpServer.Authentication.AuthenticationModule.CheckAuthentication(System.String,System.String,System.String@,System.Object@)"> <summary> - Requests a url through ajax + Used to invoke the authentication delegate that is used to lookup the user name/realm. </summary> - <param name="url">url to fetch</param> - <param name="options">optional options in format "key, value, key, value", used in JS request object.</param> - <returns>a link tag</returns> - <remarks>All javascript option names should end with colon.</remarks> - <example> - <code> - JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); - </code> - </example> + <param name="realm">Realm (domain) that user want to authenticate in</param> + <param name="userName">User name</param> + <param name="password">Password used for validation. Some implementations got password in clear text, they are then sent to client.</param> + <param name="login">object that will be stored in the request to help you identify the user if authentication was successful.</param> + <returns>true if authentication was successful</returns> </member> - <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.AjaxUpdater(System.String,System.String,System.String[])"> + <member name="M:HttpServer.Authentication.AuthenticationModule.AuthenticationRequired(HttpServer.IHttpRequest)"> <summary> - Ajax requests that updates an element with - the fetched content + Determines if authentication is required. </summary> - <param name="url">Url to fetch content from</param> - <param name="targetId">element to update</param> - <param name="options">optional options in format "key, value, key, value", used in JS updater object.</param> - <returns>A link tag.</returns> - <remarks>All javascript option names should end with colon.</remarks> - <example> - <code> - JSHelper.AjaxUpdater("/user/show/1", "userInfo", "onsuccess:", "alert('Successful!');"); - </code> - </example> + <param name="request">HTTP request from browser</param> + <returns>true if user should be authenticated.</returns> + <remarks>throw <see cref="T:HttpServer.Exceptions.ForbiddenException"/> from your delegate if no more attempts are allowed.</remarks> + <exception cref="T:HttpServer.Exceptions.ForbiddenException">If no more attempts are allowed</exception> </member> - <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.DialogLink(System.String,System.String,System.String[])"> + <member name="P:HttpServer.Authentication.AuthenticationModule.Name"> <summary> - A link that pop ups a Dialog (overlay div) + name used in HTTP request. </summary> - <param name="url">url to contents of dialog</param> - <param name="title">link title</param> - <returns>A "a"-tag that popups a dialog when clicked</returns> - <param name="htmlAttributes">name/value of html attributes</param> - <example> - WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); - </example> </member> - <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.CloseDialog"> + <member name="M:HttpServer.Authentication.DigestAuthentication.#ctor(HttpServer.Authentication.AuthenticationHandler,HttpServer.Authentication.AuthenticationRequiredHandler)"> <summary> - Close a javascript dialog window/div. + Initializes a new instance of the <see cref="T:HttpServer.Authentication.DigestAuthentication"/> class. </summary> - <returns>javascript for closing a dialog.</returns> - <see cref="M:HttpServer.Helpers.JavascriptHelperImplementation.DialogLink(System.String,System.String,System.String[])"/> + <param name="authenticator">Delegate used to provide information used during authentication.</param> + <param name="authenticationRequiredHandler">Delegate used to determine if authentication is required (may be null).</param> </member> - <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.CreateDialog(System.String,System.String,System.String[])"> + <member name="M:HttpServer.Authentication.DigestAuthentication.#ctor(HttpServer.Authentication.AuthenticationHandler)"> <summary> - Creates a new modal dialog window + Initializes a new instance of the <see cref="T:HttpServer.Authentication.DigestAuthentication"/> class. </summary> - <param name="url">url to open in window.</param> - <param name="title">window title (may not be supported by all js implementations)</param> - <param name="options"></param> - <returns></returns> + <param name="authenticator">Delegate used to provide information used during authentication.</param> </member> - <member name="T:HttpServer.HttpClientContextImp"> + <member name="F:HttpServer.Authentication.DigestAuthentication.DisableNonceCheck"> <summary> - Contains a connection to a browser/client. + Used by test classes to be able to use hardcoded values </summary> </member> - <member name="T:HttpServer.IHttpClientContext"> + <member name="M:HttpServer.Authentication.DigestAuthentication.Authenticate(System.String,System.String,System.String,System.Object[])"> <summary> - Contains a connection to a browser/client. + An authentication response have been received from the web browser. + Check if it's correct </summary> + <param name="authenticationHeader">Contents from the Authorization header</param> + <param name="realm">Realm that should be authenticated</param> + <param name="httpVerb">GET/POST/PUT/DELETE etc.</param> + <param name="options">First option: true if username/password is correct but not cnonce</param> + <returns> + Authentication object that is stored for the request. A user class or something like that. + </returns> + <exception cref="T:System.ArgumentException">if authenticationHeader is invalid</exception> + <exception cref="T:System.ArgumentNullException">If any of the paramters is empty or null.</exception> </member> - <member name="M:HttpServer.IHttpClientContext.Disconnect(System.Net.Sockets.SocketError)"> + <member name="M:HttpServer.Authentication.DigestAuthentication.Encrypt(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String)"> <summary> - Disconnect from client + Encrypts parameters into a Digest string </summary> - <param name="error">error to report in the <see cref="T:HttpServer.ClientDisconnectedHandler"/> delegate.</param> + <param name="realm">Realm that the user want to log into.</param> + <param name="userName">User logging in</param> + <param name="password">Users password.</param> + <param name="method">HTTP method.</param> + <param name="uri">Uri/domain that generated the login prompt.</param> + <param name="qop">Quality of Protection.</param> + <param name="nonce">"Number used ONCE"</param> + <param name="nc">Hexadecimal request counter.</param> + <param name="cnonce">"Client Number used ONCE"</param> + <returns>Digest encrypted string</returns> </member> - <member name="M:HttpServer.IHttpClientContext.Respond(System.String,System.Net.HttpStatusCode,System.String,System.String)"> + <member name="M:HttpServer.Authentication.DigestAuthentication.Encrypt(System.String,System.String,System.String,System.String,System.String,System.String)"> <summary> - Send a response. + </summary> - <param name="httpVersion">Either HttpHelper.HTTP10 or HttpHelper.HTTP11</param> - <param name="statusCode">http status code</param> - <param name="reason">reason for the status code.</param> - <param name="body">html body contents, can be null or empty.</param> - <exception cref="T:System.ArgumentException">If httpVersion is invalid.</exception> + <param name="ha1">Md5 hex encoded "userName:realm:password", without the quotes.</param> + <param name="ha2">Md5 hex encoded "method:uri", without the quotes</param> + <param name="qop">Quality of Protection</param> + <param name="nonce">"Number used ONCE"</param> + <param name="nc">Hexadecimal request counter.</param> + <param name="cnonce">Client number used once</param> + <returns></returns> </member> - <member name="M:HttpServer.IHttpClientContext.Respond(System.String,System.Net.HttpStatusCode,System.String)"> + <member name="M:HttpServer.Authentication.DigestAuthentication.CreateResponse(System.String,System.Object[])"> <summary> - Send a response. + Create a response that can be sent in the WWW-Authenticate header. </summary> - <param name="httpVersion">Either HttpHelper.HTTP10 or HttpHelper.HTTP11</param> - <param name="statusCode">http status code</param> - <param name="reason">reason for the status code.</param> + <param name="realm">Realm that the user should authenticate in</param> + <param name="options">First options specifies if true if username/password is correct but not cnonce.</param> + <returns>A correct auth request.</returns> + <exception cref="T:System.ArgumentNullException">If realm is empty or null.</exception> </member> - <member name="M:HttpServer.IHttpClientContext.Respond(System.String)"> + <member name="M:HttpServer.Authentication.DigestAuthentication.Decode(System.String,System.Text.Encoding)"> <summary> - Send a response. + Decodes authorization header value </summary> - <exception cref="T:System.ArgumentNullException"></exception> + <param name="buffer">header value</param> + <param name="encoding">Encoding that the buffer is in</param> + <returns>All headers and their values if successful; otherwise null</returns> + <example> + NameValueCollection header = DigestAuthentication.Decode("response=\"6629fae49393a05397450978507c4ef1\",\r\nc=00001", Encoding.ASCII); + </example> + <remarks>Can handle lots of whitespaces and new lines without failing.</remarks> </member> - <member name="M:HttpServer.IHttpClientContext.Send(System.Byte[])"> + <member name="M:HttpServer.Authentication.DigestAuthentication.GetCurrentNonce"> <summary> - send a whole buffer + Gets the current nonce. </summary> - <param name="buffer">buffer to send</param> - <exception cref="T:System.ArgumentNullException"></exception> + <returns></returns> </member> - <member name="M:HttpServer.IHttpClientContext.Send(System.Byte[],System.Int32,System.Int32)"> + <member name="M:HttpServer.Authentication.DigestAuthentication.GetMD5HashBinHex2(System.String)"> <summary> - Send data using the stream + Gets the Md5 hash bin hex2. </summary> - <param name="buffer">Contains data to send</param> - <param name="offset">Start position in buffer</param> - <param name="size">number of bytes to send</param> - <exception cref="T:System.ArgumentNullException"></exception> - <exception cref="T:System.ArgumentOutOfRangeException"></exception> + <param name="toBeHashed">To be hashed.</param> + <returns></returns> </member> - <member name="P:HttpServer.IHttpClientContext.Secured"> + <member name="M:HttpServer.Authentication.DigestAuthentication.IsValidNonce(System.String)"> <summary> - Using SSL or other encryption method. + determines if the nonce is valid or has expired. + </summary> + <param name="nonce">nonce value (check wikipedia for info)</param> + <returns>true if the nonce has not expired.</returns> + </member> + <member name="P:HttpServer.Authentication.DigestAuthentication.Name"> + <summary> + name used in http request. </summary> </member> - <member name="F:HttpServer.HttpClientContextImp.BufferSize"> + <member name="P:HttpServer.Authentication.DigestAuthentication.TokenIsHA1"> <summary> - Buffersize determines how large the HTTP header can be. + Gets or sets whether the token supplied in <see cref="T:HttpServer.Authentication.AuthenticationHandler"/> is a + HA1 generated string. </summary> </member> - <member name="M:HttpServer.HttpClientContextImp.#ctor(System.Boolean,System.Net.IPEndPoint,HttpServer.RequestReceivedHandler,HttpServer.ClientDisconnectedHandler,System.IO.Stream,HttpServer.ILogWriter,System.Net.Sockets.Socket)"> + <member name="T:HttpServer.IHttpContextHandler"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.HttpClientContextImp"/> class. + Class that receives Requests from a <see cref="T:HttpServer.IHttpClientContext"/>. </summary> - <param name="secured">true if the connection is secured (SSL/TLS)</param> - <param name="remoteEndPoint">client that connected.</param> - <param name="requestHandler">delegate handling incoming requests.</param> - <param name="disconnectHandler">delegate being called when a client disconnectes</param> - <param name="stream">Stream used for communication</param> - <exception cref="T:System.Net.Sockets.SocketException">If beginreceive fails</exception> - <param name="writer">delegate used to write log entries</param> - <see cref="T:HttpServer.RequestReceivedHandler"/> - <see cref="T:HttpServer.ClientDisconnectedHandler"/> </member> - <member name="M:HttpServer.HttpClientContextImp.#ctor(System.Boolean,System.Net.IPEndPoint,System.IO.Stream,HttpServer.RequestReceivedHandler,System.Net.Sockets.Socket)"> + <member name="M:HttpServer.IHttpContextHandler.ClientDisconnected(HttpServer.IHttpClientContext,System.Net.Sockets.SocketError)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.HttpClientContextImp"/> class. + Client have been disconnected. </summary> - <param name="secured">true if the connection is secured (SSL/TLS)</param> - <param name="requestHandler">delegate handling incoming requests.</param> - <param name="remoteEndPoint">client that connected</param> - <param name="stream">Stream used for communication</param> - <exception cref="T:System.Net.Sockets.SocketException">If beginreceive fails</exception> - <see cref="T:HttpServer.RequestReceivedHandler"/> - <see cref="T:HttpServer.ClientDisconnectedHandler"/> + <param name="client">Client that was disconnected.</param> + <param name="error">Reason</param> + <see cref="T:HttpServer.IHttpClientContext"/> </member> - <member name="M:HttpServer.HttpClientContextImp.Disconnect(System.Net.Sockets.SocketError)"> + <member name="M:HttpServer.IHttpContextHandler.RequestReceived(HttpServer.IHttpClientContext,HttpServer.IHttpRequest)"> <summary> - Disconnect from client + Invoked when a client context have received a new HTTP request </summary> - <param name="error">error to report in the <see cref="T:HttpServer.ClientDisconnectedHandler"/> delegate.</param> + <param name="client">Client that received the request.</param> + <param name="request">Request that was received.</param> + <see cref="T:HttpServer.IHttpClientContext"/> </member> - <member name="M:HttpServer.HttpClientContextImp.Check100Continue"> + <member name="T:HttpServer.RealmHandler"> <summary> - This method checks the request if a responde to 100-continue should be sent. + Delegate used to find a realm/domain. </summary> + <param name="domain"></param> + <returns></returns> <remarks> - 100 continue is a value in the Expect header. - It's used to let the webserver determine if a request can be handled. The client - waits for a reply before sending the body. + Realms are used during HTTP Authentication </remarks> + <seealso cref="T:HttpServer.Authentication.AuthenticationModule"/> + <seealso cref="T:HttpServer.Authentication.AuthenticationHandler"/> </member> - <member name="M:HttpServer.HttpClientContextImp.Respond(System.String,System.Net.HttpStatusCode,System.String,System.String)"> + <member name="T:HttpServer.HttpServer"> <summary> - Send a response. + A complete HTTP server, you need to add a module to it to be able to handle incoming requests. </summary> - <param name="httpVersion">Either HttpHelper.HTTP10 or HttpHelper.HTTP11</param> - <param name="statusCode">http status code</param> - <param name="reason">reason for the status code.</param> - <param name="body">html body contents, can be null or empty.</param> - <exception cref="T:System.ArgumentException">If httpVersion is invalid.</exception> + <example> + <code> + // this small example will add two web site modules, thus handling + // two different sites. In reality you should add Controller modules or something + // two the website modules to be able to handle different requests. + HttpServer server = new HttpServer(); + server.Add(new WebSiteModule("www.gauffin.com", "Gauffin Telecom AB")); + server.Add(new WebSiteModule("www.vapadi.se", "Remote PBX")); + + // start regular http + server.Start(IPAddress.Any, 80); + + // start https + server.Start(IPAddress.Any, 443, myCertificate); + </code> + </example> + <seealso cref="T:HttpServer.HttpModules.HttpModule"/> + <seealso cref="T:HttpServer.HttpModules.FileModule"/> + <seealso cref="T:HttpServer.HttpListener"/> </member> - <member name="M:HttpServer.HttpClientContextImp.Respond(System.String,System.Net.HttpStatusCode,System.String)"> + <member name="M:HttpServer.HttpServer.#ctor(HttpServer.IComponentProvider)"> <summary> - Send a response. + Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. </summary> - <param name="httpVersion">Either HttpHelper.HTTP10 or HttpHelper.HTTP11</param> - <param name="statusCode">http status code</param> - <param name="reason">reason for the status code.</param> + <param name="provider">Used to get all components used in the server..</param> </member> - <member name="M:HttpServer.HttpClientContextImp.Respond(System.String)"> + <member name="M:HttpServer.HttpServer.#ctor"> <summary> - Send a response. + Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. </summary> - <exception cref="T:System.ArgumentNullException"></exception> </member> - <member name="M:HttpServer.HttpClientContextImp.Send(System.Byte[])"> + <member name="M:HttpServer.HttpServer.#ctor(HttpServer.FormDecoders.FormDecoderProvider)"> <summary> - send a whole buffer + Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. </summary> - <param name="buffer">buffer to send</param> - <exception cref="T:System.ArgumentNullException"></exception> + <param name="decoderProvider">Form decoders are used to convert different types of posted data to the <see cref="T:HttpServer.HttpInput"/> object types.</param> + <seealso cref="T:HttpServer.FormDecoders.IFormDecoder"/> + <seealso cref="P:HttpServer.HttpServer.FormDecoderProviders"/> </member> - <member name="M:HttpServer.HttpClientContextImp.Send(System.Byte[],System.Int32,System.Int32)"> + <member name="M:HttpServer.HttpServer.#ctor(HttpServer.Sessions.IHttpSessionStore)"> <summary> - Send data using the stream + Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. </summary> - <param name="buffer">Contains data to send</param> - <param name="offset">Start position in buffer</param> - <param name="size">number of bytes to send</param> - <exception cref="T:System.ArgumentNullException"></exception> - <exception cref="T:System.ArgumentOutOfRangeException"></exception> + <param name="sessionStore">A session store is used to save and retrieve sessions</param> + <seealso cref="T:HttpServer.Sessions.IHttpSessionStore"/> </member> - <member name="P:HttpServer.HttpClientContextImp.Secured"> + <member name="M:HttpServer.HttpServer.#ctor(HttpServer.ILogWriter)"> <summary> - Using SSL or other encryption method. + Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. </summary> + <param name="logWriter">The log writer.</param> + <seealso cref="P:HttpServer.HttpServer.LogWriter"/> </member> - <member name="T:HttpServer.ClientDisconnectedHandler"> + <member name="M:HttpServer.HttpServer.#ctor(HttpServer.FormDecoders.FormDecoderProvider,HttpServer.ILogWriter)"> <summary> - Client have been disconnected. + Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. </summary> - <param name="client">Client that was disconnected.</param> - <param name="error">Reason</param> - <see cref="T:HttpServer.IHttpClientContext"/> + <param name="decoderProvider">Form decoders are used to convert different types of posted data to the <see cref="T:HttpServer.HttpInput"/> object types.</param> + <param name="logWriter">The log writer.</param> + <seealso cref="T:HttpServer.FormDecoders.IFormDecoder"/> + <seealso cref="P:HttpServer.HttpServer.FormDecoderProviders"/> + <seealso cref="P:HttpServer.HttpServer.LogWriter"/> </member> - <member name="T:HttpServer.RequestReceivedHandler"> + <member name="M:HttpServer.HttpServer.#ctor(HttpServer.FormDecoders.FormDecoderProvider,HttpServer.Sessions.IHttpSessionStore,HttpServer.ILogWriter)"> <summary> - Invoked when a client context have received a new HTTP request + Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. </summary> - <param name="client">Client that received the request.</param> - <param name="request">Request that was received.</param> - <see cref="T:HttpServer.IHttpClientContext"/> + <param name="decoderProvider">Form decoders are used to convert different types of posted data to the <see cref="T:HttpServer.HttpInput"/> object types.</param> + <param name="sessionStore">A session store is used to save and retrieve sessions</param> + <param name="logWriter">The log writer.</param> + <seealso cref="T:HttpServer.FormDecoders.IFormDecoder"/> + <seealso cref="P:HttpServer.HttpServer.FormDecoderProviders"/> + <seealso cref="P:HttpServer.HttpServer.LogWriter"/> + <seealso cref="T:HttpServer.Sessions.IHttpSessionStore"/> </member> - <member name="T:HttpServer.HttpModules.ControllerModule"> + <member name="M:HttpServer.HttpServer.Add(HttpServer.Rules.IRule)"> <summary> - A controller module is a part of the ModelViewController design pattern. - It gives you a way to create user friendly URLs. + Adds the specified rule. </summary> - <remarks> - The controller module uses the flyweight pattern which means that - the memory usage will continue to increase until the module have - enough objects in memory to serve all concurrent requests. The objects - are reused and will not be freed. - </remarks> - <example> - <code> - ControllerModule module = new ControllerModule(); - module.Add(new UserController()); - module.Add(new SearchController()); - myWebsite.Add(module); - </code> - </example> + <param name="rule">The rule.</param> </member> - <member name="T:HttpServer.HttpModules.HttpModule"> + <member name="M:HttpServer.HttpServer.Add(HttpServer.HttpModules.HttpModule)"> <summary> - A HttpModule can be used to serve urls. The module itself - decides if it should serve a url or not. In this way, you can - get a very flexible http app since you can let multiple modules - serve almost similiar urls. + Add a <see cref="T:HttpServer.HttpModules.HttpModule"/> to the server. </summary> - <remarks> - Throw UnauthorizedException if you are using a AuthenticationModule and want to prompt for username/password. - </remarks> + <param name="module">mode to add</param> </member> - <member name="M:HttpServer.HttpModules.HttpModule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> + <member name="M:HttpServer.HttpServer.DecodeBody(HttpServer.IHttpRequest)"> <summary> - Method that process the url + Decodes the request body. </summary> - <param name="request">Information sent by the browser about the request</param> - <param name="response">Information that is being sent back to the client.</param> - <param name="session">Session used to </param> - <returns>true if this module handled the request.</returns> + <param name="request">The request.</param> + <exception cref="T:HttpServer.Exceptions.InternalServerException">Failed to decode form data.</exception> </member> - <member name="M:HttpServer.HttpModules.HttpModule.SetLogWriter(HttpServer.ILogWriter)"> + <member name="M:HttpServer.HttpServer.ErrorPage(HttpServer.IHttpResponse,System.Net.HttpStatusCode,System.String)"> <summary> - Set the log writer to use. + Generate a HTTP error page (that will be added to the response body). + response status code is also set. </summary> - <param name="writer">logwriter to use.</param> + <param name="response">Response that the page will be generated in.</param> + <param name="error"><see cref="T:System.Net.HttpStatusCode"/>.</param> + <param name="body">response body contents.</param> </member> - <member name="M:HttpServer.HttpModules.HttpModule.Write(HttpServer.LogPrio,System.String)"> + <member name="M:HttpServer.HttpServer.ErrorPage(HttpServer.IHttpResponse,HttpServer.Exceptions.HttpException)"> <summary> - Log something. + Generate a HTTP error page (that will be added to the response body). + response status code is also set. </summary> - <param name="prio">importance of log message</param> - <param name="message">message</param> + <param name="response">Response that the page will be generated in.</param> + <param name="err">exception.</param> </member> - <member name="P:HttpServer.HttpModules.HttpModule.AllowSecondaryProcessing"> + <member name="M:HttpServer.HttpServer.GetRealm(HttpServer.IHttpRequest)"> <summary> - If true specifies that the module doesn't consume the processing of a request so that subsequent modules - can continue processing afterwards. Default is false. + Realms are used by the <see cref="T:HttpServer.Authentication.AuthenticationModule"/>s. </summary> + <param name="request">HTTP request</param> + <returns>domain/realm.</returns> </member> - <member name="M:HttpServer.HttpModules.ControllerModule.Add(HttpServer.Controllers.RequestController)"> + <member name="M:HttpServer.HttpServer.HandleRequest(HttpServer.IHttpClientContext,HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> <summary> - The controller module uses the prototype design pattern - to be able to create new controller objects for requests - if the stack is empty. + Process an incoming request. </summary> - <param name="prototype">A prototype which will be cloned for each request</param> - <exception cref="T:System.ArgumentNullException"></exception> - <exception cref="T:System.InvalidProgramException">If a controller with that name have been added already.</exception> + <param name="context">connection to client</param> + <param name="request">request information</param> + <param name="response">response that should be filled</param> + <param name="session">session information</param> </member> - <member name="M:HttpServer.HttpModules.ControllerModule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> + <member name="M:HttpServer.HttpServer.OnClientDisconnected(HttpServer.IHttpClientContext,System.Net.Sockets.SocketError)"> <summary> - Method that process the incoming request. + Can be overloaded to implement stuff when a client have been connected. </summary> - <param name="request">Information sent by the browser about the request</param> - <param name="response">Information that is being sent back to the client.</param> - <param name="session">Session used to </param> + <remarks> + Default implementation does nothing. + </remarks> + <param name="client">client that disconnected</param> + <param name="error">disconnect reason</param> </member> - <member name="P:HttpServer.HttpModules.ControllerModule.Item(System.String)"> + <member name="M:HttpServer.HttpServer.ProcessAuthentication(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> <summary> - Get a prototype + Handle authentication </summary> - <param name="controllerName">in lowercase, without "Controller"</param> - <returns>The controller if found; otherwise null.</returns> - <example> - <code> - //fetches the class UserController - RequestController userController = controllerModule["user"]; - </code> - </example> + <param name="request"></param> + <param name="response"></param> + <param name="session"></param> + <returns>true if request can be handled; false if not.</returns> + <exception cref="T:HttpServer.Exceptions.BadRequestException">Invalid authorization header</exception> </member> - <member name="M:HttpServer.HttpModules.ControllerModule.ControllerContext.#ctor(HttpServer.Controllers.RequestController)"> + <member name="M:HttpServer.HttpServer.RequestAuthentication(HttpServer.Authentication.AuthenticationModule,HttpServer.IHttpRequest,HttpServer.IHttpResponse)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.HttpModules.ControllerModule.ControllerContext"/> class. + Will request authentication. </summary> - <param name="prototype">A controller used to handle certain URLs. Will be cloned for each parallel request.</param> + <remarks> + Sends respond to client, nothing else can be done with the response after this. + </remarks> + <param name="mod"></param> + <param name="request"></param> + <param name="response"></param> </member> - <member name="M:HttpServer.HttpModules.ControllerModule.ControllerContext.Pop"> + <member name="M:HttpServer.HttpServer.OnRequest(System.Object,HttpServer.RequestEventArgs)"> <summary> - Retrieve a previously created controller (or a new one if none exist). + Received from a <see cref="T:HttpServer.IHttpClientContext"/> when a request have been parsed successfully. </summary> - <returns></returns> + <param name="source"><see cref="T:HttpServer.IHttpClientContext"/> that received the request.</param> + <param name="args">The request.</param> </member> - <member name="M:HttpServer.HttpModules.ControllerModule.ControllerContext.Push(HttpServer.Controllers.RequestController)"> + <member name="M:HttpServer.HttpServer.ProcessRequestWrapper(HttpServer.IHttpClientContext,HttpServer.IHttpRequest)"> <summary> - Add a controller + To be able to track request count. </summary> - <param name="controller"></param> + <param name="context"></param> + <param name="request"></param> </member> - <member name="P:HttpServer.HttpModules.ControllerModule.ControllerContext.Prototype"> + <member name="M:HttpServer.HttpServer.Start(System.Net.IPAddress,System.Int32)"> <summary> - Prototype controller used for cloning. + Start the web server using regular HTTP. </summary> - <value>The prototype.</value> + <param name="address">IP Address to listen on, use <c>IpAddress.Any </c>to accept connections on all IP addresses/network cards.</param> + <param name="port">Port to listen on. 80 can be a good idea =)</param> + <exception cref="T:System.ArgumentNullException"><c>address</c> is null.</exception> + <exception cref="T:System.ArgumentException">Port must be a positive number.</exception> </member> - <member name="T:HttpServer.Helpers.JSHelper"> + <member name="M:HttpServer.HttpServer.Start(System.Net.IPAddress,System.Int32,System.Security.Cryptography.X509Certificates.X509Certificate)"> <summary> - Will contain helper functions for javascript. + Accept secure connections. </summary> + <param name="address">IP Address to listen on, use <see cref="F:System.Net.IPAddress.Any"/> to accept connections on all IP Addresses / network cards.</param> + <param name="port">Port to listen on. 80 can be a good idea =)</param> + <param name="certificate">Certificate to use</param> + <exception cref="T:System.ArgumentNullException"><c>address</c> is null.</exception> + <exception cref="T:System.ArgumentException">Port must be a positive number.</exception> </member> - <member name="M:HttpServer.Helpers.JSHelper.AjaxRequest(System.String,System.String[])"> + <member name="M:HttpServer.HttpServer.Stop"> <summary> - Requests a url through ajax + shut down the server and listeners </summary> - <param name="url">url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself.</param> - <param name="options">optional options in format "key, value, key, value", used in JS request object. All keys should end with colon.</param> - <returns>a link tag</returns> - <remarks>onclick attribute is used by this method.</remarks> - <example> - <code> - // plain text - JSHelper.AjaxRequest("'/user/show/1'"); - - // ajax request using this.href - string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>"; - </code> - </example> </member> - <member name="M:HttpServer.Helpers.JSHelper.AjaxUpdater(System.String,System.String,System.String[])"> + <member name="M:HttpServer.HttpServer.WriteLog(HttpServer.LogPrio,System.String)"> <summary> - Ajax requests that updates an element with - the fetched content + write an entry to the log file </summary> - <param name="url">url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself.</param> - <param name="targetId">element to update</param> - <param name="options">options in format "key, value, key, value". All keys should end with colon.</param> - <returns>A link tag.</returns> - <example> - <code> - JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true"); - </code> - </example> + <param name="prio">importance of the message</param> + <param name="message">log message</param> </member> - <member name="M:HttpServer.Helpers.JSHelper.CreateDialog(System.String,System.String,System.String[])"> + <member name="M:HttpServer.HttpServer.WriteLog(System.Object,HttpServer.LogPrio,System.String)"> <summary> - Opens contents in a dialog window. + write an entry to the log file </summary> - <param name="url">url to contents of dialog</param> - <param name="title">link title</param> - <param name="options">name, value, name, value, all parameter names should end with colon.</param> + <param name="source">object that wrote the message</param> + <param name="prio">importance of the message</param> + <param name="message">log message</param> </member> - <member name="M:HttpServer.Helpers.JSHelper.CloseDialog"> + <member name="P:HttpServer.HttpServer.Current"> <summary> - Close a javascript dialog window/div. + Server that is handling the current request. </summary> - <returns>javascript for closing a dialog.</returns> - <see cref="M:HttpServer.Helpers.JSHelper.CreateDialog(System.String,System.String,System.String[])"/> + <remarks> + Will be set as soon as a request arrives to the <see cref="T:HttpServer.HttpServer"/> object. + </remarks> </member> - <member name="T:HttpServer.Helpers.GetIdTitle"> + <member name="P:HttpServer.HttpServer.AuthenticationModules"> <summary> - Delegate used by <see cref="M:HttpServer.Helpers.FormHelper.Select(System.String,System.Collections.IEnumerable,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"/> to populate select options. + Modules used for authentication. The module that is is added first is used as + the default authentication module. </summary> - <param name="obj">current object (for instance a User).</param> - <param name="id">Text that should be displayed in the value part of a <optiongt;-tag.</param> - <param name="title">Text shown in the select list.</param> - <example> - // Class that is going to be used in a SELECT-tag. - public class User - { - private readonly string _realName; - private readonly int _id; - public User(int id, string realName) - { - _id = id; - _realName = realName; - } - public string RealName - { - get { return _realName; } - } - - public int Id - { - get { return _id; } - } - } - - // Using an inline delegate to generate the select list - public void UserInlineDelegate() - { - List<User> items = new List<User>(); - items.Add(new User(1, "adam")); - items.Add(new User(2, "bertial")); - items.Add(new User(3, "david")); - string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value) - { - User user = (User)o; - id = user.Id; - value = user.RealName; - }, 2, true); - } - - // Using an method as delegate to generate the select list. - public void UseExternalDelegate() - { - List<User> items = new List<User>(); - items.Add(new User(1, "adam")); - items.Add(new User(2, "bertial")); - items.Add(new User(3, "david")); - string htmlSelect = Select("users", "users", items, UserOptions, 1, true); - } - - // delegate returning id and title - public static void UserOptions(object o, out object id, out object title) - { - User user = (User)o; - id = user.Id; - value = user.RealName; - } /// </example> + <remarks>Use the corresponding property + in the <see cref="T:HttpServer.HttpModules.WebSiteModule"/> if you are using multiple websites.</remarks> </member> - <member name="T:HttpServer.Controllers.BeforeFilterAttribute"> + <member name="P:HttpServer.HttpServer.FormDecoderProviders"> <summary> - Methods marked with BeforeFilter will be invoked before each request. + Form decoder providers are used to decode request body (which normally contains form data). </summary> - <remarks> - BeforeFilters should take no arguments and return false - if controller method should not be invoked. - </remarks> - <seealso cref="T:HttpServer.Controllers.FilterPosition"/> </member> - <member name="M:HttpServer.Controllers.BeforeFilterAttribute.#ctor"> + <member name="P:HttpServer.HttpServer.ServerName"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Controllers.BeforeFilterAttribute"/> class. + Server name sent in HTTP responses. </summary> <remarks> - BeforeFilters should take no arguments and return false - if controller method should not be invoked. + Do NOT include version in name, since it makes it + easier for hackers. </remarks> </member> - <member name="M:HttpServer.Controllers.BeforeFilterAttribute.#ctor(HttpServer.Controllers.FilterPosition)"> + <member name="P:HttpServer.HttpServer.SessionCookieName"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Controllers.BeforeFilterAttribute"/> class. + Name of cookie where session id is stored. </summary> - <param name="position">Specify if the filter should be invoked among the first filters, in between or among the last.</param> - <remarks> - BeforeFilters should take no arguments and return false - if controller method should not be invoked. - </remarks> </member> - <member name="P:HttpServer.Controllers.BeforeFilterAttribute.Position"> + <member name="P:HttpServer.HttpServer.LogWriter"> <summary> - Filters position in before filter queue + Specified where logging should go. </summary> + <seealso cref="T:HttpServer.NullLogWriter"/> + <seealso cref="T:HttpServer.ConsoleLogWriter"/> + <seealso cref="P:HttpServer.HttpServer.LogWriter"/> </member> - <member name="T:HttpServer.Controllers.FilterPosition"> + <member name="P:HttpServer.HttpServer.BackLog"> <summary> - Determins when a before filter is executed. + Number of connections that can wait to be accepted by the server. </summary> - <seealso cref="T:HttpServer.Controllers.BeforeFilterAttribute"/> + <remarks>Default is 10.</remarks> </member> - <member name="F:HttpServer.Controllers.FilterPosition.First"> + <member name="P:HttpServer.HttpServer.MaxRequestCount"> <summary> - Filter will be invoked first (unless another filter is added after this one with the First position) + Gets or sets maximum number of allowed simultaneous requests. </summary> + <remarks> + <para> + This property is useful in busy systems. The HTTP server + will start queuing new requests if this limit is hit, instead + of trying to process all incoming requests directly. + </para> + <para> + The default number if allowed simultaneous requests are 10. + </para> + </remarks> </member> - <member name="F:HttpServer.Controllers.FilterPosition.Between"> + <member name="P:HttpServer.HttpServer.MaxQueueSize"> <summary> - Invoke after all first filters, and before the last filters. + Gets or sets maximum number of requests queuing to be handled. </summary> + <remarks> + <para> + The WebServer will start turning requests away if response code + <see cref="F:System.Net.HttpStatusCode.ServiceUnavailable"/> to indicate that the server + is too busy to be able to handle the request. + </para> + </remarks> </member> - <member name="F:HttpServer.Controllers.FilterPosition.Last"> + <member name="E:HttpServer.HttpServer.RealmWanted"> <summary> - Filter will be invoked last (unless another filter is added after this one with the Last position) + Realms are used during HTTP authentication. + Default realm is same as server name. </summary> </member> - <member name="T:HttpServer.Authentication.BasicAuthentication"> + <member name="E:HttpServer.HttpServer.ExceptionThrown"> <summary> - The "basic" authentication scheme is based on the model that the - client must authenticate itself with a user-ID and a password for - each realm. The realm value should be considered an opaque string - which can only be compared for equality with other realms on that - server. The server will service the request only if it can validate - the user-ID and password for the protection space of the Request-URI. - There are no optional authentication parameters. + Let's to receive unhandled exceptions from the threads. </summary> + <remarks> + Exceptions will be thrown during debug mode if this event is not used, + exceptions will be printed to console and suppressed during release mode. + </remarks> </member> - <member name="T:HttpServer.Authentication.AuthModule"> + <member name="T:HttpServer.Helpers.WebHelper"> <summary> - Authentication modules are used to implement different - kind of http authentication. + Webhelper provides helpers for common tasks in HTML. </summary> </member> - <member name="M:HttpServer.Authentication.AuthModule.#ctor(HttpServer.Authentication.AuthenticationHandler,HttpServer.Authentication.AuthRequiredDelegate)"> + <member name="F:HttpServer.Helpers.WebHelper.JSImplementation"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Authentication.AuthModule"/> class. + Used to let the website use different javascript libraries. + Default is <see cref="T:HttpServer.Helpers.Implementations.PrototypeImp"/> </summary> - <param name="authenticator">Delegate used to provide information used during authentication.</param> - <param name="authRequiredDelegate">Delegate used to determine if authentication is required (may be null).</param> </member> - <member name="M:HttpServer.Authentication.AuthModule.#ctor(HttpServer.Authentication.AuthenticationHandler)"> + <member name="M:HttpServer.Helpers.WebHelper.AjaxRequest(System.String,System.String,System.String[])"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Authentication.AuthModule"/> class. + Creates a link that invokes through ajax. </summary> - <param name="authenticator">Delegate used to provide information used during authentication.</param> + <param name="url">url to fetch</param> + <param name="title">link title</param> + <param name="options"> + optional options in format "key, value, key, value". + Javascript options starts with ':'. + </param> + <returns>a link tag</returns> + <example> + WebHelper.AjaxRequest("/users/add/", "Add user", "method:", "post", "onclick", "validate('this');"); + </example> </member> - <member name="M:HttpServer.Authentication.AuthModule.CreateResponse(System.String,System.Object[])"> + <member name="M:HttpServer.Helpers.WebHelper.AjaxUpdater(System.String,System.String,System.String,System.String[])"> <summary> - Create a response that can be sent in the WWW-Authenticate header. + Builds a link that updates an element with the fetched ajax content. </summary> - <param name="realm">Realm that the user should authenticate in</param> - <param name="options">Array with optional options.</param> - <returns>A correct auth request.</returns> - <exception cref="T:System.ArgumentNullException">If realm is empty or null.</exception> + <param name="url">Url to fetch content from</param> + <param name="title">link title</param> + <param name="targetId">html element to update with the results of the ajax request.</param> + <param name="options">optional options in format "key, value, key, value"</param> + <returns>A link tag.</returns> </member> - <member name="M:HttpServer.Authentication.AuthModule.Authenticate(System.String,System.String,System.String,System.Object[])"> + <member name="M:HttpServer.Helpers.WebHelper.DialogLink(System.String,System.String,System.String[])"> <summary> - An authentication response have been received from the web browser. - Check if it's correct + A link that pop ups a Dialog (overlay div) </summary> - <param name="authenticationHeader">Contents from the Authorization header</param> - <param name="realm">Realm that should be authenticated</param> - <param name="httpVerb">GET/POST/PUT/DELETE etc.</param> - <param name="options">options to specific implementations</param> - <returns>Authentication object that is stored for the request. A user class or something like that.</returns> - <exception cref="T:System.ArgumentException">if authenticationHeader is invalid</exception> - <exception cref="T:System.ArgumentNullException">If any of the paramters is empty or null.</exception> + <param name="url">url to contents of dialog</param> + <param name="title">link title</param> + <param name="htmlAttributes">name/value of html attributes.</param> + <returns>A "a"-tag that popups a dialog when clicked</returns> + <example> + WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); + </example> </member> - <member name="M:HttpServer.Authentication.AuthModule.CheckAuthentication(System.String,System.String,System.String@,System.Object@)"> + <member name="M:HttpServer.Helpers.WebHelper.CreateDialog(System.String,System.String,System.String[])"> <summary> - Used to invoke the auth delegate that is used to lookup the username/realm. + Create/Open a dialog box using ajax </summary> - <param name="realm">Realm (domain) that user want to authenticate in</param> - <param name="userName">Username</param> - <param name="password">Password used for validation. Some implementations got password in clear text, they are then sent to client.</param> - <param name="login">object that will be stored in the request to help you identify the user if authentication was successful.</param> - <returns>true if authentication was successful</returns> + <param name="url"></param> + <param name="title"></param> + <param name="parameters"></param> + <returns></returns> </member> - <member name="M:HttpServer.Authentication.AuthModule.AuthenticationRequired(HttpServer.IHttpRequest)"> + <member name="M:HttpServer.Helpers.WebHelper.CloseDialog"> <summary> - Determines if authentication is required. + Close a javascript dialog window/div. </summary> - <param name="request">Http request from browser</param> - <returns>true if user should be authenticated.</returns> - <remarks>throw ForbiddenException from your delegate if no more attempts are allowed.</remarks> - <exception cref="T:HttpServer.Exceptions.ForbiddenException">If no more attempts are allowed</exception> + <returns>javascript for closing a dialog.</returns> + <see cref="M:HttpServer.Helpers.WebHelper.DialogLink(System.String,System.String,System.String[])"/> </member> - <member name="P:HttpServer.Authentication.AuthModule.Name"> + <member name="M:HttpServer.Helpers.WebHelper.FormStart(System.String,System.String,System.Boolean)"> <summary> - name used in http request. + Create a <form> tag. </summary> + <param name="name">name of form</param> + <param name="action">action to invoke on submit</param> + <param name="isAjax">form should be posted as ajax</param> + <returns>html code</returns> + <example> + WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax); + </example> </member> - <member name="M:HttpServer.Authentication.BasicAuthentication.#ctor(HttpServer.Authentication.AuthenticationHandler,HttpServer.Authentication.AuthRequiredDelegate)"> + <member name="M:HttpServer.Helpers.WebHelper.Link(System.String,System.String,System.String[])"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Authentication.BasicAuthentication"/> class. + Create a link tag. </summary> - <param name="authenticator">Delegate used to provide information used during authentication.</param> - <param name="authRequiredDelegate">Delegate used to determine if authentication is required (may be null).</param> + <param name="url">url to go to</param> + <param name="title">link title (text that is displayed)</param> + <param name="htmlAttributes">html attributes, name, value, name, value</param> + <returns>html code</returns> + <example> + WebHelper.Link("/user/show/1", "Show user", "id", "showUser", "onclick", "return confirm('Are you shure?');"); + </example> </member> - <member name="M:HttpServer.Authentication.BasicAuthentication.#ctor(HttpServer.Authentication.AuthenticationHandler)"> + <member name="M:HttpServer.Helpers.WebHelper.BuildLink(System.String,System.String,System.String[])"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Authentication.BasicAuthentication"/> class. + Build a link </summary> - <param name="authenticator">Delegate used to provide information used during authentication.</param> + <param name="url">url to go to.</param> + <param name="title">title of link (displayed text)</param> + <param name="htmlAttributes">extra html attributes.</param> + <returns>a complete link</returns> </member> - <member name="M:HttpServer.Authentication.BasicAuthentication.CreateResponse(System.String,System.Object[])"> + <member name="M:HttpServer.Helpers.WebHelper.BuildLink(System.String,System.String,System.String[],System.String[])"> <summary> - Create a response that can be sent in the WWW-Authenticate header. + Build a link </summary> - <param name="realm">Realm that the user should authenticate in</param> - <param name="options">Not used in basic auth</param> - <returns>A correct auth request.</returns> + <param name="url">url to go to.</param> + <param name="title">title of link (displayed text)</param> + <param name="htmlAttributes">extra html attributes.</param> + <returns>a complete link</returns> + <param name="options">more options</param> </member> - <member name="M:HttpServer.Authentication.BasicAuthentication.Authenticate(System.String,System.String,System.String,System.Object[])"> + <member name="M:HttpServer.Helpers.WebHelper.Select(System.String,System.Collections.ICollection,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"> <summary> - An authentication response have been received from the web browser. - Check if it's correct + Obsolete </summary> - <param name="authenticationHeader">Contents from the Authorization header</param> - <param name="realm">Realm that should be authenticated</param> - <param name="httpVerb">GET/POST/PUT/DELETE etc.</param> - <param name="options">Not used in basic auth</param> - <returns>Authentication object that is stored for the request. A user class or something like that.</returns> - <exception cref="T:System.ArgumentException">if authenticationHeader is invalid</exception> - <exception cref="T:System.ArgumentNullException">If any of the paramters is empty or null.</exception> + <param name="name">Obsolete</param> + <param name="collection">Obsolete</param> + <param name="getIdTitle">Obsolete</param> + <param name="selectedValue">Obsolete</param> + <param name="firstEmpty">Obsolete</param> + <returns>Obsolete</returns> </member> - <member name="P:HttpServer.Authentication.BasicAuthentication.Name"> + <member name="M:HttpServer.Helpers.WebHelper.Select(System.String,System.String,System.Collections.ICollection,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"> <summary> - name used in http request. + Obsolete </summary> + <param name="name">Obsolete</param> + <param name="id">Obsolete</param> + <param name="collection">Obsolete</param> + <param name="getIdTitle">Obsolete</param> + <param name="selectedValue">Obsolete</param> + <param name="firstEmpty">Obsolete</param> + <returns>Obsolete</returns> </member> - <member name="T:HttpServer.Rendering.Haml.Nodes.DisplayCodeNode"> + <member name="M:HttpServer.Helpers.WebHelper.List(System.Collections.Generic.IEnumerable{System.Object},System.String)"> <summary> - The follow node allows users to display code in a haml document + Render errors into a UL with class "errors" </summary> - <example> - #main Welcome =user.FirstName - </example> + <param name="className">class used by UL-tag.</param> + <param name="theList">items to list</param> + <returns>an unordered html list.</returns> </member> - <member name="T:HttpServer.Rendering.Haml.Nodes.ChildNode"> + <member name="M:HttpServer.Helpers.WebHelper.List(System.Collections.Specialized.NameValueCollection,System.String)"> <summary> - Child nodes may not be the first node on a line + Render errors into a UL with class "errors" </summary> + <param name="className">class used by UL-tag.</param> + <param name="theList">items to list</param> + <returns>an unordered html list.</returns> </member> - <member name="T:HttpServer.Rendering.Haml.Nodes.Node"> + <member name="M:HttpServer.Helpers.WebHelper.Errors(System.Collections.Specialized.NameValueCollection)"> <summary> - A node represents a controller code and contents. For example a html tag, an attribute list or something else. + Render errors into a UL with class "errors" </summary> + <param name="errors"></param> + <returns></returns> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.Node.#ctor(HttpServer.Rendering.Haml.Nodes.Node)"> + <member name="M:HttpServer.Helpers.WebHelper.GenerateHtmlAttributes(System.Text.StringBuilder,System.String[],System.String[])"> <summary> - Add a new node + Generates a list with html attributes. </summary> - <param name="parent">parent node.</param> + <param name="sb">StringBuilder that the options should be added to.</param> + <param name="firstOptions">attributes set by user.</param> + <param name="secondOptions">attributes set by any of the helper classes.</param> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.Node.AddModifier(HttpServer.Rendering.Haml.Nodes.Node)"> + <member name="M:HttpServer.Helpers.WebHelper.GenerateHtmlAttributes(System.Text.StringBuilder,System.String[])"> <summary> - Modifiers are used to modify the first node on the line. - Typical modifiers are attribute lists, class names and IDs. + Generates a list with html attributes. </summary> - <param name="node">Modifier node</param> + <param name="sb">StringBuilder that the options should be added to.</param> + <param name="options"></param> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.Node.Parse(HttpServer.Rendering.Haml.NodeList,HttpServer.Rendering.Haml.Nodes.Node,HttpServer.Rendering.Haml.LineInfo,System.Int32@)"> + <member name="T:HttpServer.Helpers.JavascriptHelperImplementation"> <summary> - Parse node contents add return a fresh node. + Purpose of this class is to create a javascript toolkit independent javascript helper. </summary> - <param name="prototypes">List containing all node types</param> - <param name="parent">Node that this is a subnode to. Can be null</param> - <param name="line">Line to parse</param> - <param name="offset">Where to start the parsing. Should be set to where the next node should start parsing.</param> - <returns>A node corresponding to the bla bla; null if parsing failed.</returns> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException"></exception> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.Node.CanHandle(System.String,System.Boolean)"> + <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.GenerateOptions(System.Text.StringBuilder,System.String[],System.Boolean)"> <summary> - determines if this node can handle the line (by checking the first word); + Generates a list with JS options. </summary> - <param name="word">Controller char (word)</param> - <returns>true if text belongs to this node type</returns> - <param name="firstNode">First node on line, used since some nodes cannot exist on their own on a line.</param> + <param name="sb">StringBuilder that the options should be added to.</param> + <param name="options">the javascript options. name, value pairs. each string value should be escaped by YOU!</param> + <param name="startWithComma">true if we should start with a comma.</param> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.Node.ToHtml"> + <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.RemoveJavascriptOptions(System.String[])"> <summary> - Generate HTML code (with ASP tags) + Removes any javascript parameters from an array of parameters </summary> - <returns></returns> + <param name="options">The array of parameters to remove javascript params from</param> + <returns>An array of html parameters</returns> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.Node.ToCode(System.Boolean@)"> + <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.AjaxFormOnSubmit(System.String[])"> <summary> - Converts the node to c# code + javascript action that should be added to the "onsubmit" event in the form tag. </summary> - <param name="inString">true if we are inside the internal stringbuilder</param> - <returns>c# code</returns> + <returns></returns> + <remarks>All javascript option names should end with colon.</remarks> + <example> + <code> + JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); + </code> + </example> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.Node.ToCode(System.Boolean@,System.Boolean)"> + <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.AjaxRequest(System.String,System.String[])"> <summary> - Convert the node to c# code + Requests a url through ajax </summary> - <param name="inString">True if we are inside the internal stringbuilder</param> - <param name="smallEnough">true if all subnodes fit on one line</param> - <returns>c# code</returns> + <param name="url">url to fetch</param> + <param name="options">optional options in format "key, value, key, value", used in JS request object.</param> + <returns>a link tag</returns> + <remarks>All javascript option names should end with colon.</remarks> + <example> + <code> + JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); + </code> + </example> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.Node.ToCode(System.Boolean@,System.Boolean,System.Boolean)"> + <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.AjaxUpdater(System.String,System.String,System.String[])"> <summary> - Generate C# code of the node + Ajax requests that updates an element with + the fetched content </summary> - <param name="inString">true if we are inside the internal stringbuilder</param> - <param name="smallEnough">code is small enough to fit on one row.</param> - <param name="smallEnoughIsDefaultValue">smallEnough is a default value, recalc it</param> - <returns>c# code</returns> + <param name="url">Url to fetch content from</param> + <param name="targetId">element to update</param> + <param name="options">optional options in format "key, value, key, value", used in JS updater object.</param> + <returns>A link tag.</returns> + <remarks>All javascript option names should end with colon.</remarks> + <example> + <code> + JSHelper.AjaxUpdater("/user/show/1", "userInfo", "onsuccess:", "alert('Successful!');"); + </code> + </example> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.Node.GetIntendation"> + <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.DialogLink(System.String,System.String,System.String[])"> <summary> - Get intendation level for this node. + A link that pop ups a Dialog (overlay div) </summary> - <returns></returns> + <param name="url">url to contents of dialog</param> + <param name="title">link title</param> + <returns>A "a"-tag that popups a dialog when clicked</returns> + <param name="htmlAttributes">name/value of html attributes</param> + <example> + WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); + </example> </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.Node.IsTextNode"> + <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.CloseDialog"> <summary> - Returns true if the node is applicable after another node as text instead of being applied as a modifier + Close a javascript dialog window/div. </summary> + <returns>javascript for closing a dialog.</returns> + <see cref="M:HttpServer.Helpers.JavascriptHelperImplementation.DialogLink(System.String,System.String,System.String[])"/> </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.Node.AllChildrenCount"> + <member name="M:HttpServer.Helpers.JavascriptHelperImplementation.CreateDialog(System.String,System.String,System.String[])"> <summary> - Count our children and our childrens children and so on... + Creates a new modal dialog window </summary> + <param name="url">url to open in window.</param> + <param name="title">window title (may not be supported by all js implementations)</param> + <param name="options"></param> + <returns></returns> </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.Node.Children"> + <member name="T:HttpServer.Helpers.Implementations.PrototypeImp"> <summary> - All child nodes for this node. + PrototypeJS implementation of the javascript functions. </summary> </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.Node.LineInfo"> + <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.AjaxRequest(System.String,System.String[])"> <summary> - Should only be set for each parent. + Requests a url through ajax </summary> + <param name="url">url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself.</param> + <param name="options">optional options in format "key, value, key, value", used in JS request object. All keys should end with colon.</param> + <returns>a link tag</returns> + <remarks>onclick attribute is used by this method.</remarks> + <example> + <code> + // plain text + JSHelper.AjaxRequest("'/user/show/1'"); + + // ajax request using this.href + string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>"; + </code> + </example> </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.Node.Modifiers"> + <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.Contains(System.Collections.Generic.IEnumerable{System.String},System.String)"> <summary> - Modifiers are used to modify the first node on the line. - Typical modifiers are attribute lists, class names and IDs. + Determins if a list of strings contains a specific value </summary> + <param name="options">options to check in</param> + <param name="value">value to find</param> + <returns>true if value was found</returns> + <remarks>case insensitive</remarks> </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.Node.LastModifier"> + <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.AjaxUpdater(System.String,System.String,System.String[])"> <summary> - Last modifier for this node + Ajax requests that updates an element with + the fetched content </summary> - <seealso cref="P:HttpServer.Rendering.Haml.Nodes.Node.Modifiers"/> + <param name="url">URL to fetch. URL is NOT enclosed in quotes by the implementation. You need to do that yourself.</param> + <param name="targetId">element to update</param> + <param name="options">options in format "key, value, key, value". All keys should end with colon.</param> + <returns>A link tag.</returns> + <example> + <code> + JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true"); + </code> + </example> </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.Node.ModifierCount"> + <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.DialogLink(System.String,System.String,System.String[])"> <summary> - Number of modifiers for this line. + A link that pop ups a Dialog (overlay div) </summary> + <param name="url">URL to contents of dialog</param> + <param name="title">link title</param> + <param name="htmlAttributes">name, value, name, value</param> + <returns> + A "a"-tag that popups a dialog when clicked + </returns> + <remarks><para>Requires Control.Modal found here: http://livepipe.net/projects/control_modal/</para> + And the following JavaScript (load it in application.js): + <code> + Event.observe(window, 'load', + function() { + document.getElementsByClassName('modal').each(function(link){ new Control.Modal(link); }); + } + ); + </code> + </remarks> + <example> + WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); + </example> </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.Node.Parent"> + <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.CreateDialog(System.String,System.String,System.String[])"> <summary> - Parent node. + create a modal dialog (usually using DIVs) </summary> + <param name="url">url to fetch</param> + <param name="title">dialog title</param> + <param name="options">javascript/html attributes. javascript options ends with colon ':'.</param> + <returns></returns> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.ChildNode.#ctor(HttpServer.Rendering.Haml.Nodes.Node)"> + <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.CloseDialog"> <summary> - Child nodes may not be the first node on a line + Close a javascript dialog window/div. </summary> - <param name="parent">parent node</param> + <returns>javascript for closing a dialog.</returns> + <see cref="M:HttpServer.Helpers.Implementations.PrototypeImp.DialogLink(System.String,System.String,System.String[])"/> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.ChildNode.AddMe(HttpServer.Rendering.Haml.NodeList,HttpServer.Rendering.Haml.Nodes.Node,HttpServer.Rendering.Haml.LineInfo,HttpServer.Rendering.Haml.Nodes.Node)"> + <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.AjaxFormOnSubmit(System.String[])"> <summary> - Creates a DIV node and add's the specified node to it. + javascript action that should be added to the "onsubmit" event in the form tag. </summary> - <param name="prototypes">Contains all prototypes for each control char. used to instanciate new nodes.</param> - <param name="parent">parent node</param> - <param name="line">current line information</param> - <param name="me">node to add to the DIV node</param> - <returns>current node</returns> + <param name="options">remember to encapsulate strings in ''</param> + <returns></returns> + <remarks>All javascript option names should end with colon.</remarks> + <example> + <code> + JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); + </code> + </example> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.ChildNode.GetEndPos(System.Int32,System.String,System.Char)"> + <member name="T:HttpServer.IHttpRequestParser"> <summary> - Get endposition for this modifier. + Event driven parser used to parse incoming HTTP requests. </summary> - <param name="offset">where to start searching</param> - <param name="line">contents of the current line</param> - <param name="terminator">char that tells us that this is the end position</param> - <returns>index on the current line</returns> + <remarks> + The parser supports partial messages and keeps the states between + each parsed buffer. It's therefore important that the parser gets + <see cref="M:HttpServer.IHttpRequestParser.Clear"/>ed if a client disconnects. + </remarks> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.ChildNode.GetEndPos(System.Int32,System.String)"> + <member name="M:HttpServer.IHttpRequestParser.Parse(System.Byte[],System.Int32,System.Int32)"> <summary> - Get endposition for this modifier. + Parse partial or complete message. </summary> - <param name="offset">where to start searching</param> - <param name="line">contents of the current line</param> - <returns>index on the current line</returns> + <param name="buffer">buffer containing incoming bytes</param> + <param name="offset">where in buffer that parsing should start</param> + <param name="count">number of bytes to parse</param> + <returns>Unparsed bytes left in buffer.</returns> + <exception cref="T:HttpServer.Exceptions.BadRequestException"><c>BadRequestException</c>.</exception> </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.ChildNode.IsTextNode"> + <member name="M:HttpServer.IHttpRequestParser.Clear"> <summary> - This is a plain text node + Clear parser state. </summary> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.DisplayCodeNode.#ctor(HttpServer.Rendering.Haml.Nodes.Node)"> + <member name="P:HttpServer.IHttpRequestParser.CurrentState"> <summary> - Contains C# code that will be rendered into the view. + Current state in parser. </summary> - <param name="parent">Parent node</param> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.DisplayCodeNode.Parse(HttpServer.Rendering.Haml.NodeList,HttpServer.Rendering.Haml.Nodes.Node,HttpServer.Rendering.Haml.LineInfo,System.Int32@)"> + <member name="E:HttpServer.IHttpRequestParser.RequestCompleted"> <summary> - Parse node contents add return a fresh node. + A request have been successfully parsed. </summary> - <param name="prototypes">List containing all node types</param> - <param name="parent">Node that this is a subnode to. Can be null</param> - <param name="line">Line to parse</param> - <param name="offset">Where to start the parsing. Should be set to where the next node should start parsing.</param> - <returns>A node corresponding to the bla bla; null if parsing failed.</returns> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException"></exception> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.DisplayCodeNode.CanHandle(System.String,System.Boolean)"> + <member name="E:HttpServer.IHttpRequestParser.BodyBytesReceived"> <summary> - determines if this node can handle the line (by checking the first word); + More body bytes have been received. </summary> - <param name="word">Controller char (word)</param> - <returns>true if text belongs to this node type</returns> - <param name="firstNode">first node on line</param> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.DisplayCodeNode.ToHtml"> + <member name="E:HttpServer.IHttpRequestParser.RequestLineReceived"> <summary> - Generate HTML for this node (with asp tags for code) + Request line have been received. </summary> - <returns></returns> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.DisplayCodeNode.ToCode(System.Boolean@,System.Boolean,System.Boolean)"> + <member name="E:HttpServer.IHttpRequestParser.HeaderReceived"> <summary> - = is placed at the end of a tag definition, after class, id, and attribute declarations. - It’s just a shortcut for inserting Ruby code into an element. It works the same as = without a tag: - it inserts the result of the Ruby code into the template. - However, if the result is short enough, it is displayed entirely on one line. + A header have been received. </summary> - <param name="inString">True if we are inside the internal stringbuilder</param> - <param name="smallEnough">true if all subnodes fit on one line</param> - <param name="smallEnoughIsDefaultValue">smallEnough is a default value, recalc it</param> - <returns>c# code</returns> </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.DisplayCodeNode.IsTextNode"> + <member name="P:HttpServer.IHttpRequestParser.LogWriter"> <summary> - Determines if this is a textnode (containg plain text) + Gets or sets the log writer. </summary> </member> - <member name="T:HttpServer.Rendering.Haml.Nodes.AttributeNode"> + <member name="T:HttpServer.RequestParserState"> <summary> - Contains HTML attributes. + Current state in the parsing. </summary> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.AttributeNode.#ctor(HttpServer.Rendering.Haml.Nodes.Node,System.Collections.Generic.List{HttpServer.Rendering.Haml.Nodes.AttributeNode.Attribute})"> + <member name="F:HttpServer.RequestParserState.FirstLine"> <summary> - Create a new node + Should parse the request line </summary> - <param name="parent">parent node</param> - <param name="col">collection of attributes</param> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.AttributeNode.#ctor(HttpServer.Rendering.Haml.Nodes.Node)"> + <member name="F:HttpServer.RequestParserState.HeaderName"> <summary> - create an attribute node + Searching for a complete header name </summary> - <param name="parent">parent node</param> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.AttributeNode.GetAttribute(System.String)"> + <member name="F:HttpServer.RequestParserState.AfterName"> <summary> - Get an attribute + Searching for colon after header name (ignoring white spaces) </summary> - <param name="name">name of the attribute (case sensitive)</param> - <returns>attribute if found; otherwise null.</returns> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.AttributeNode.Parse(HttpServer.Rendering.Haml.NodeList,HttpServer.Rendering.Haml.Nodes.Node,HttpServer.Rendering.Haml.LineInfo,System.Int32@)"> + <member name="F:HttpServer.RequestParserState.Between"> <summary> - Parse node contents add return a fresh node. + Searching for start of header value (ignoring white spaces) </summary> - <param name="prototypes">List containing all node types</param> - <param name="parent">Node that this is a subnode to. Can be null</param> - <param name="line">Line to parse</param> - <param name="offset">Where to start the parsing. Should be set to where the next node should start parsing.</param> - <returns>A node corresponding to the bla bla; null if parsing failed.</returns> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException"></exception> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.AttributeNode.CanHandle(System.String,System.Boolean)"> + <member name="F:HttpServer.RequestParserState.HeaderValue"> <summary> - determines if this node can handle the line (by checking the first word); + Searching for a complete header value (can span over multiple lines, as long as they are prefixed with one/more whitespaces) </summary> - <param name="word">Controller char (word)</param> - <returns>true if text belongs to this node type</returns> - <param name="firstNode">first node on line</param> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.AttributeNode.ToHtml"> + <member name="F:HttpServer.RequestParserState.Body"> <summary> - Convert node to HTML (with ASP-tags) + Adding bytes to body </summary> - <returns>HTML string</returns> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.AttributeNode.ToCode(System.Boolean@,System.Boolean,System.Boolean)"> + <member name="T:HttpServer.IHttpRequest"> <summary> - Convert the node to c# code + Contains server side HTTP request information. </summary> - <param name="inString">True if we are inside the internal stringbuilder</param> - <param name="smallEnough">true if all subnodes fit on one line</param> - <param name="smallEnoughIsDefaultValue">smallEnough is a default value, recalc it</param> - <returns>c# code</returns> </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.AttributeNode.Attributes"> + <member name="M:HttpServer.IHttpRequest.AddHeader(System.String,System.String)"> <summary> - html attributes + Called during parsing of a <see cref="T:HttpServer.IHttpRequest"/>. </summary> + <param name="name">Name of the header, should not be URL encoded</param> + <param name="value">Value of the header, should not be URL encoded</param> + <exception cref="T:HttpServer.Exceptions.BadRequestException">If a header is incorrect.</exception> </member> - <member name="T:HttpServer.Rendering.Haml.Nodes.AttributeNode.Attribute"> + <member name="M:HttpServer.IHttpRequest.AddToBody(System.Byte[],System.Int32,System.Int32)"> <summary> - A attribute + Add bytes to the body </summary> + <param name="bytes">buffer to read bytes from</param> + <param name="offset">where to start read</param> + <param name="length">number of bytes to read</param> + <returns>Number of bytes actually read (same as length unless we got all body bytes).</returns> + <exception cref="T:System.InvalidOperationException">If body is not writable</exception> + <exception cref="T:System.ArgumentNullException"><c>bytes</c> is null.</exception> + <exception cref="T:System.ArgumentOutOfRangeException"><c>offset</c> is out of range.</exception> </member> - <member name="F:HttpServer.Rendering.Haml.Nodes.AttributeNode.Attribute.Simple"> + <member name="M:HttpServer.IHttpRequest.Clear"> <summary> - value is a simple word or quoted text + Clear everything in the request </summary> </member> - <member name="F:HttpServer.Rendering.Haml.Nodes.AttributeNode.Attribute.Name"> + <member name="M:HttpServer.IHttpRequest.DecodeBody(HttpServer.FormDecoders.FormDecoderProvider)"> <summary> - Name of the attribute + Decode body into a form. </summary> + <param name="providers">A list with form decoders.</param> + <exception cref="T:System.IO.InvalidDataException">If body contents is not valid for the chosen decoder.</exception> + <exception cref="T:System.InvalidOperationException">If body is still being transferred.</exception> </member> - <member name="F:HttpServer.Rendering.Haml.Nodes.AttributeNode.Attribute.Value"> + <member name="M:HttpServer.IHttpRequest.SetCookies(HttpServer.RequestCookies)"> <summary> - Value, can be a statement, variable or quoted text. + Sets the cookies. </summary> + <param name="cookies">The cookies.</param> </member> - <member name="T:HttpServer.Rendering.TemplateArguments"> + <member name="M:HttpServer.IHttpRequest.CreateResponse(HttpServer.IHttpClientContext)"> <summary> - Arguments being used in a template. + Create a response object. </summary> - <seealso cref="T:HttpServer.Rendering.TemplateManager"/> - <seealso cref="T:HttpServer.Rendering.ITinyTemplate"/> + <param name="context">Context for the connected client.</param> + <returns>A new <see cref="T:HttpServer.IHttpResponse"/>.</returns> </member> - <member name="F:HttpServer.Rendering.TemplateArguments._arguments"> + <member name="P:HttpServer.IHttpRequest.AcceptTypes"> <summary> - Holds the arguments connected to their names for quick access. - (since the ArgumentContainer also holds the name for the argument the mapping with strings is somewhat redundant - but since the data do 'belong' to the ArgumentContainer this solution was chosen to speed up access) + Gets kind of types accepted by the client. </summary> </member> - <member name="M:HttpServer.Rendering.TemplateArguments.#ctor"> + <member name="P:HttpServer.IHttpRequest.Body"> <summary> - Initializes the class without any set arguments. + Gets or sets body stream. </summary> </member> - <member name="M:HttpServer.Rendering.TemplateArguments.#ctor(HttpServer.Rendering.TemplateArguments)"> + <member name="P:HttpServer.IHttpRequest.BodyIsComplete"> <summary> - Initializes the class with all the arguments of the parameter class. + Gets whether the body is complete. </summary> - <param name="arguments">Cannot be null</param> - <exception cref="T:System.ArgumentNullException">If arguments is null</exception> </member> - <member name="M:HttpServer.Rendering.TemplateArguments.#ctor(System.Object[])"> + <member name="P:HttpServer.IHttpRequest.Connection"> <summary> - Initializes the class with the objects in the parameterlist. - Note that each object that is null must be followed by a type. + Gets or sets kind of connection used for the session. </summary> - <param name="arguments">Should contain ordered pairs/truples of string, object and type where type is optional if the object isn´t null</param> - <example>new TemplateArguments("Dir", "\", "Users", null, typeof(User));</example> - <exception cref="T:System.ArgumentException">If optional type differs from type of object (if object != null) or argument name is duplicate</exception> - <exception cref="T:System.ArgumentException">If the order of objects is incorrect</exception> - <exception cref="T:System.ArgumentNullException">If any argument name or type is null</exception> </member> - <member name="M:HttpServer.Rendering.TemplateArguments.Update(HttpServer.Rendering.TemplateArguments)"> + <member name="P:HttpServer.IHttpRequest.ContentLength"> <summary> - A function that merges two argument holders updating and adding values + Gets or sets number of bytes in the body. </summary> - <param name="arguments"></param> - <exception cref="T:System.ArgumentNullException">If arguments is null</exception> </member> - <member name="M:HttpServer.Rendering.TemplateArguments.Finalize"> + <member name="P:HttpServer.IHttpRequest.Cookies"> <summary> - Clears added arguments + Gets cookies that was sent with the request. </summary> </member> - <member name="M:HttpServer.Rendering.TemplateArguments.Add(System.String,System.Object)"> + <member name="P:HttpServer.IHttpRequest.Form"> <summary> - Adds an argument. - (Will throw ArgumentException on duplicates since adding an argument twice points to incorrect code, for ways around - this <see cref="M:HttpServer.Rendering.TemplateArguments.Update(System.String,System.Object)"/> + Gets form parameters. </summary> - <param name="argumentName">Cannot be null</param> - <param name="argumentObject">Cannot be null</param> - <exception cref="T:System.NullReferenceException">If argumentName or argumentObject is null</exception> - <exception cref="T:System.ArgumentException">If an argument named argumentName already exists</exception> </member> - <member name="M:HttpServer.Rendering.TemplateArguments.Add(System.String,System.Object,System.Type)"> + <member name="P:HttpServer.IHttpRequest.Headers"> <summary> - Adds an argument. Allows for argumentObject to be null - (Will throw ArgumentException <see cref="M:HttpServer.Rendering.TemplateArguments.Add(System.String,System.Object)"/> + Gets headers sent by the client. </summary> - <param name="argumentName">Cannot be null</param> - <param name="argumentObject"></param> - <param name="argumentType">Cannot be null</param> - <exception cref="T:System.NullReferenceException">If argumentName or argumentType is null</exception> - <exception cref="T:System.ArgumentException">If an argument named argumentName already exists or argumentObject != null and typeof(argumentObject) differs from argumentType</exception> </member> - <member name="M:HttpServer.Rendering.TemplateArguments.Update(System.String,System.Object)"> + <member name="P:HttpServer.IHttpRequest.HttpVersion"> <summary> - Updates an already added argument + Gets or sets version of HTTP protocol that's used. </summary> - <param name="argumentName">Cannot be null</param> - <param name="argumentObject">Cannot be null</param> - <exception cref="T:System.ArgumentException">If no argument named argumentName exists</exception> - <exception cref="T:System.ArgumentNullException">If argumentName or argumentObject is null</exception> + <remarks> + Probably <see cref="F:HttpServer.HttpHelper.HTTP10"/> or <see cref="F:HttpServer.HttpHelper.HTTP11"/>. + </remarks> + <seealso cref="T:HttpServer.HttpHelper"/> </member> - <member name="M:HttpServer.Rendering.TemplateArguments.Update(System.String,System.Object,System.Type)"> + <member name="P:HttpServer.IHttpRequest.IsAjax"> <summary> - Updates an already added argument, allows for argumentObject to be null + Gets whether the request was made by Ajax (Asynchronous JavaScript) </summary> - <param name="argumentName">Cannot be null</param> - <param name="argumentObject"></param> - <param name="argumentType">Cannot be null</param> - <exception cref="T:System.ArgumentNullException">If argumentName or argumentType is null</exception> - <exception cref="T:System.ArgumentException">If an argument named argumentName doesn´t exists or argumentObject != null and typeof(argumentObject) differs from argumentType</exception> </member> - <member name="M:HttpServer.Rendering.TemplateArguments.Clear"> + <member name="P:HttpServer.IHttpRequest.Method"> <summary> - Clears all added arguments + Gets or sets requested method. </summary> + <remarks> + Will always be in upper case. + </remarks> + <see cref="P:HttpServer.IHttpRequest.Method"/> </member> - <member name="M:HttpServer.Rendering.TemplateArguments.GetArguments"> + <member name="P:HttpServer.IHttpRequest.Param"> <summary> - Retrieves the arguments - (Does so now by copying the values to a new array, could be optimized?) + Gets parameter from <see cref="P:HttpServer.IHttpRequest.QueryString"/> or <see cref="P:HttpServer.IHttpRequest.Form"/>. </summary> - <returns>An array containing arguments with name, object and type</returns> </member> - <member name="M:HttpServer.Rendering.TemplateArguments.GetHashCode"> + <member name="P:HttpServer.IHttpRequest.QueryString"> <summary> - Returns a individual hashcode built upon the specified types the class is holding + Gets variables sent in the query string </summary> - <remarks>The hashcode is made by joining the typenames of all held arguments and making a string hashcode from them</remarks> - <returns></returns> </member> - <member name="M:HttpServer.Rendering.TemplateArguments.GetFullTypeName(System.Type)"> + <member name="P:HttpServer.IHttpRequest.Uri"> <summary> - Retrieves a concated typename ie DictinaryInt32String + Gets or sets requested URI. </summary> - <param name="type">The type to retrieve the name for</param> </member> - <member name="M:HttpServer.Rendering.TemplateArguments.Contains(System.String)"> + <member name="P:HttpServer.IHttpRequest.UriParts"> <summary> - Checks whether a specific argument is specified or not. + Gets URI absolute path divided into parts. </summary> - <param name="name">Argument name</param> - <returns>true if argument is specified; otherwise false.</returns> + <example> + // URI is: http://gauffin.com/code/tiny/ + Console.WriteLine(request.UriParts[0]); // result: code + Console.WriteLine(request.UriParts[1]); // result: tiny + </example> + <remarks> + If you're using controllers than the first part is controller name, + the second part is method name and the third part is Id property. + </remarks> + <seealso cref="P:HttpServer.IHttpRequest.Uri"/> </member> - <member name="P:HttpServer.Rendering.TemplateArguments.Item(System.String)"> + <member name="P:HttpServer.IHttpRequest.UriPath"> <summary> - Function to make it possible to index out known arguments + Gets or sets path and query. </summary> - <param name="name">The name of an added argument</param> - <returns>Null if no ArgumentContainer by name was found</returns> + <see cref="P:HttpServer.IHttpRequest.Uri"/> + <remarks> + Are only used during request parsing. Cannot be set after "Host" header have been + added. + </remarks> </member> - <member name="T:HttpServer.Rendering.ArgumentContainer"> - <summary> - A container class grouping mapping name, argument type and the argument object - </summary> - </member> - <member name="F:HttpServer.Rendering.ArgumentContainer._argumentName"> - <summary> - Contains the name mapped to the argument - </summary> - </member> - <member name="F:HttpServer.Rendering.ArgumentContainer._argumentType"> - <summary> - Contains the type of the argument, this must be valid if _argumentObject is null - </summary> - </member> - <member name="F:HttpServer.Rendering.ArgumentContainer._argumentObject"> - <summary> - Holds the actual object - </summary> - </member> - <member name="M:HttpServer.Rendering.ArgumentContainer.#ctor(System.String,System.Object)"> - <summary> - Constructor to initiate an ArgumentContainer, will set the ArgumentType to the value of the argumentObject's type - </summary> - <param name="argumentName">Cannot be null</param> - <param name="argumentObject">Cannot be null</param> - <exception cref="T:System.ArgumentNullException">If argumentName or argumentObject is null</exception> - </member> - <member name="M:HttpServer.Rendering.ArgumentContainer.#ctor(System.String,System.Object,System.Type)"> - <summary> - Alternative constructor allowing argumentObject parameter to be null - </summary> - <param name="argumentName">Cannot be null</param> - <param name="argumentObject"></param> - <param name="argumentType">Cannot be null</param> - <exception cref="T:System.NullReferenceException">If argumentName or argumentType is null</exception> - <exception cref="T:System.ArgumentException">If argumentObject != null and argumentType != typeof(argumentObject)</exception> - </member> - <member name="M:HttpServer.Rendering.ArgumentContainer.SetObject(System.Object)"> - <summary> - Sets the object and type of the argument, equal to ArgumentContainer.Object = ... - </summary> - <param name="argumentObject">Cannot be null</param> - <exception cref="T:System.ArgumentNullException">If argumentObject is null</exception> - </member> - <member name="M:HttpServer.Rendering.ArgumentContainer.SetObject(System.Object,System.Type)"> - <summary> - Sets the argument object and type. Type of the object and argumentType must correspond. - </summary> - <param name="argumentObject"></param> - <param name="argumentType">Cannot be null</param> - <exception cref="T:System.ArgumentNullException">If argumentType is null</exception> - <exception cref="T:System.ArgumentException">If typeof(argumentObject) differs from argumentType and object != null</exception> - </member> - <member name="P:HttpServer.Rendering.ArgumentContainer.Name"> - <summary> - Attribute for retrieving the name. The name cannot be set however because an argument is defined by its name - changing the name would be changing the arguments meaning, thus an argument needing a name change should rather - be recreated - </summary> - </member> - <member name="P:HttpServer.Rendering.ArgumentContainer.Type"> - <summary> - Returns the type of the argument object. The property cannot be set since the type depends on and must correspond to - the type of the object - </summary> - </member> - <member name="P:HttpServer.Rendering.ArgumentContainer.Object"> - <summary> - Returns or changes the argument object. If the object is to be changed to null the type must be passed aswell, - in that case <see cref="M:HttpServer.Rendering.ArgumentContainer.SetObject(System.Object,System.Type)"/> - </summary> - <exception cref="T:System.ArgumentNullException">If set value is null</exception> - </member> - <member name="T:HttpServer.Rendering.Haml.Nodes.PartialNode"> - <summary> - A partial is a HAML template that is inserted into other HAML templates. - </summary> - </member> - <member name="F:HttpServer.Rendering.Haml.Nodes.PartialNode._target"> + <member name="T:HttpServer.Authentication.AuthenticationHandler"> <summary> - Contains the page/controller target for the partial. - The PartialNode should be written as follows: - ex. - - _"requestedpage"{parametername="parametervalue",parametername2=parameter2,parametername3=parameter3:typeof(parameter3type)} + Delegate used to let authentication modules authenticate the user name and password. </summary> + <param name="realm">Realm that the user want to authenticate in</param> + <param name="userName">User name specified by client</param> + <param name="token">Can either be user password or implementation specific token.</param> + <param name="login">object that will be stored in a session variable called <see cref="F:HttpServer.Authentication.AuthenticationModule.AuthenticationTag"/> if authentication was successful.</param> + <exception cref="T:HttpServer.Exceptions.ForbiddenException">throw forbidden exception if too many attempts have been made.</exception> + <remarks> + <para> + Use <see cref="P:HttpServer.Authentication.DigestAuthentication.TokenIsHA1"/> to specify that the token is a HA1 token. (MD5 generated + string from realm, user name and password); Md5String(userName + ":" + realm + ":" + password); + </para> + </remarks> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.PartialNode.#ctor(HttpServer.Rendering.Haml.Nodes.Node)"> + <member name="T:HttpServer.Authentication.AuthenticationRequiredHandler"> <summary> - create a new partial node. + Let's you decide on a system level if authentication is required. </summary> - <param name="parent">parent node</param> + <param name="request">HTTP request from client</param> + <returns>true if user should be authenticated.</returns> + <remarks>throw <see cref="T:HttpServer.Exceptions.ForbiddenException"/> if no more attempts are allowed.</remarks> + <exception cref="T:HttpServer.Exceptions.ForbiddenException">If no more attempts are allowed</exception> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.PartialNode.CanHandle(System.String,System.Boolean)"> + <member name="T:HttpServer.HttpModules.ResourceFileModule"> <summary> - Determines if this node can handle the line (by checking the first word); + Serves files that are stored in embedded resources. </summary> - <param name="word">Controller char (word)</param> - <returns>True if text belongs to this node type</returns> - <param name="firstNode">First node on line.</param> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.PartialNode.Parse(HttpServer.Rendering.Haml.NodeList,HttpServer.Rendering.Haml.Nodes.Node,HttpServer.Rendering.Haml.LineInfo,System.Int32@)"> + <member name="T:HttpServer.HttpModules.HttpModule"> <summary> - Parse node contents add return a fresh node. + A HttpModule can be used to serve Uri's. The module itself + decides if it should serve a Uri or not. In this way, you can + get a very flexible http application since you can let multiple modules + serve almost similar urls. </summary> - <param name="parent">Node that this is a subnode to. Can be null</param> - <param name="prototypes">A list with node types</param> - <param name="line">Line to parse</param> - <param name="offset">Where to start the parsing. Will be set to where the next node should start parsing</param> - <returns>A node corresponding to the bla bla; null if parsing failed.</returns> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException"></exception> + <remarks> + Throw <see cref="T:HttpServer.Exceptions.UnauthorizedException"/> if you are using a <see cref="T:HttpServer.Authentication.AuthenticationModule"/> and want to prompt for user name/password. + </remarks> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.PartialNode.ToCode(System.Boolean@,System.Boolean,System.Boolean)"> + <member name="M:HttpServer.HttpModules.HttpModule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> <summary> - Convert the node to c# code + Method that process the url </summary> - <param name="inString">True if we are inside the internal stringbuilder</param> - <param name="smallEnough">true if all subnodes fit on one line</param> - <param name="smallEnoughIsDefaultValue">smallEnough is a default value, recalc it</param> - <returns>c# code</returns> + <param name="request">Information sent by the browser about the request</param> + <param name="response">Information that is being sent back to the client.</param> + <param name="session">Session used to </param> + <returns>true if this module handled the request.</returns> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.PartialNode.ToHtml"> + <member name="M:HttpServer.HttpModules.HttpModule.SetLogWriter(HttpServer.ILogWriter)"> <summary> - Convert node to HTML (with ASP-tags) + Set the log writer to use. </summary> - <returns>HTML string</returns> + <param name="writer">logwriter to use.</param> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.PartialNode.GetCode"> + <member name="M:HttpServer.HttpModules.HttpModule.Write(HttpServer.LogPrio,System.String)"> <summary> - Helper function to retrieve the code for the partial request + Log something. </summary> - <returns>A string representing the code for invocating a render of the partial</returns> + <param name="prio">importance of log message</param> + <param name="message">message</param> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.PartialNode.ThrowError(System.String)"> + <member name="P:HttpServer.HttpModules.HttpModule.AllowSecondaryProcessing"> <summary> - Throw an exception with predefined information + If true specifies that the module doesn't consume the processing of a request so that subsequent modules + can continue processing afterwards. Default is false. </summary> - <param name="reason">why the exception was thrown</param> </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.PartialNode.IsTextNode"> + <member name="M:HttpServer.HttpModules.ResourceFileModule.#ctor"> <summary> - This is a plain text node + Initializes a new instance of the <see cref="T:HttpServer.HttpModules.ResourceFileModule"/> class. + Runs <see cref="M:HttpServer.HttpModules.ResourceFileModule.AddDefaultMimeTypes"/> to make sure the basic mime types are available, they can be cleared later + through the use of <see cref="P:HttpServer.HttpModules.ResourceFileModule.MimeTypes"/> if desired. </summary> </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.PartialNode.Target"> + <member name="M:HttpServer.HttpModules.ResourceFileModule.#ctor(HttpServer.ILogWriter)"> <summary> - Returns the page/controller target for the node + Initializes a new instance of the <see cref="T:HttpServer.HttpModules.ResourceFileModule"/> class. + Runs <see cref="M:HttpServer.HttpModules.ResourceFileModule.AddDefaultMimeTypes"/> to make sure the basic mime types are available, they can be cleared later + through the use of <see cref="P:HttpServer.HttpModules.ResourceFileModule.MimeTypes"/> if desired. </summary> + <param name="logWriter">The log writer to use when logging events</param> </member> - <member name="T:HttpServer.Rendering.ResourceTemplateLoader"> + <member name="M:HttpServer.HttpModules.ResourceFileModule.AddDefaultMimeTypes"> <summary> - Loads templates from embedded resources. + Mimtypes that this class can handle per default </summary> </member> - <member name="M:HttpServer.Rendering.ResourceTemplateLoader.LoadTemplates(System.String,System.Reflection.Assembly,System.String)"> + <member name="M:HttpServer.HttpModules.ResourceFileModule.AddResources(System.String,System.Reflection.Assembly,System.String)"> <summary> - Loads templates from a namespace in the given assembly to an uri + Loads resources from a namespace in the given assembly to an uri </summary> <param name="toUri">The uri to map the resources to</param> <param name="fromAssembly">The assembly in which the resources reside</param> @@ -1819,136 +1691,107 @@ <usage> resourceLoader.LoadResources("/user/", typeof(User).Assembly, "MyLib.Models.User.Views"); - will make ie the resource MyLib.Models.User.Views.list.Haml accessible via /user/list.haml or /user/list/ + will make ie the resource MyLib.Models.User.Views.stylesheet.css accessible via /user/stylesheet.css </usage> + <returns>The amount of loaded files, giving you the possibility of making sure the resources needed gets loaded</returns> </member> - <member name="M:HttpServer.Rendering.ResourceTemplateLoader.LoadTemplate(System.String)"> - <summary> - Load a template into a <see cref="T:System.IO.TextReader"/> and return it. - </summary> - <param name="path">Relative path (and filename) to template.</param> - <returns> - a <see cref="T:System.IO.TextReader"/> if file was found; otherwise null. - </returns> - </member> - <member name="M:HttpServer.Rendering.ResourceTemplateLoader.GetFiles(System.String,System.String)"> - <summary> - Fetch all files from the resource that matches the specified arguments. - </summary> - <param name="path">Where the file should reside.</param> - <param name="filename">Files to check</param> - <returns> - a list of files if found; or an empty array if no files are found. - </returns> - </member> - <member name="M:HttpServer.Rendering.ResourceTemplateLoader.CheckTemplate(HttpServer.Rendering.ITemplateInfo)"> - <summary> - Always returns true since a resource won't be updated during execution - </summary> - <param name="info"></param> - <returns></returns> - </member> - <member name="M:HttpServer.Rendering.ResourceTemplateLoader.HasTemplate(System.String)"> - <summary> - Returns whether or not the loader has an instance of the file requested - </summary> - <param name="filename">The name of the template/file</param> - <returns>True if the loader can provide the file</returns> - </member> - <member name="T:HttpServer.LogPrio"> - <summary> - Priority for log entries - </summary> - <seealso cref="T:HttpServer.ILogWriter"/> - </member> - <member name="F:HttpServer.LogPrio.Trace"> + <member name="M:HttpServer.HttpModules.ResourceFileModule.CanHandle(HttpServer.IHttpRequest)"> <summary> - Very detailed logs to be able to follow the flow of the program. + Returns true if the module can handle the request </summary> </member> - <member name="F:HttpServer.LogPrio.Debug"> + <member name="M:HttpServer.HttpModules.ResourceFileModule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> <summary> - Logs to help debug errors in the application + Method that process the url </summary> + <param name="request">Information sent by the browser about the request</param> + <param name="response">Information that is being sent back to the client.</param> + <param name="session">Session used to </param> + <returns>true if this module handled the request.</returns> </member> - <member name="F:HttpServer.LogPrio.Info"> + <member name="P:HttpServer.HttpModules.ResourceFileModule.MimeTypes"> <summary> - Information to be able to keep track of state changes etc. + List with all mime-type that are allowed. </summary> + <remarks>All other mime types will result in a Forbidden http status code.</remarks> </member> - <member name="F:HttpServer.LogPrio.Warning"> + <member name="T:HttpServer.HttpModules.FileModule"> <summary> - Something did not go as we expected, but it's no problem. + The purpose of this module is to serve files. </summary> </member> - <member name="F:HttpServer.LogPrio.Error"> + <member name="M:HttpServer.HttpModules.FileModule.#ctor(System.String,System.String,System.Boolean)"> <summary> - Something that should not fail failed, but we can still keep - on going. + Initializes a new instance of the <see cref="T:HttpServer.HttpModules.FileModule"/> class. </summary> + <param name="baseUri">Uri to serve, for instance "/files/"</param> + <param name="basePath">Path on hard drive where we should start looking for files</param> + <param name="useLastModifiedHeader">If true a Last-Modifed header will be sent upon requests urging web browser to cache files</param> </member> - <member name="F:HttpServer.LogPrio.Fatal"> + <member name="M:HttpServer.HttpModules.FileModule.#ctor(System.String,System.String)"> <summary> - Something failed, and we cannot handle it properly. + Initializes a new instance of the <see cref="T:HttpServer.HttpModules.FileModule"/> class. </summary> + <param name="baseUri">Uri to serve, for instance "/files/"</param> + <param name="basePath">Path on hard drive where we should start looking for files</param> </member> - <member name="T:HttpServer.ILogWriter"> + <member name="M:HttpServer.HttpModules.FileModule.AddDefaultMimeTypes"> <summary> - Interface used to write to log files. + Mimtypes that this class can handle per default </summary> </member> - <member name="M:HttpServer.ILogWriter.Write(System.Object,HttpServer.LogPrio,System.String)"> + <member name="M:HttpServer.HttpModules.FileModule.CanHandle(System.Uri)"> <summary> - Write an entry to the log file. + Determines if the request should be handled by this module. + Invoked by the <see cref="T:HttpServer.HttpServer"/> </summary> - <param name="source">object that is writing to the log</param> - <param name="priority">importance of the log message</param> - <param name="message">the message</param> + <param name="uri"></param> + <returns>true if this module should handle it.</returns> </member> - <member name="T:HttpServer.ConsoleLogWriter"> - <summary> - This class writes to the console. It colors the output depending on the logprio and includes a 3-level stacktrace (in debug mode) - </summary> - <seealso cref="T:HttpServer.ILogWriter"/> + <member name="M:HttpServer.HttpModules.FileModule.GetPath(System.Uri)"> + <exception cref="T:HttpServer.Exceptions.BadRequestException">Illegal path</exception> </member> - <member name="F:HttpServer.ConsoleLogWriter.Instance"> + <member name="M:HttpServer.HttpModules.FileModule.Contains(System.String,System.Collections.Generic.IEnumerable{System.String})"> <summary> - The actual instance of this class. + check if source contains any of the chars. </summary> + <param name="source"></param> + <param name="chars"></param> + <returns></returns> </member> - <member name="M:HttpServer.ConsoleLogWriter.Write(System.Object,HttpServer.LogPrio,System.String)"> + <member name="M:HttpServer.HttpModules.FileModule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> <summary> - Logwriters the specified source. + Method that process the Uri. </summary> - <param name="source">object that wrote the logentry.</param> - <param name="prio">Importance of the log message</param> - <param name="message">The message.</param> + <param name="request">Information sent by the browser about the request</param> + <param name="response">Information that is being sent back to the client.</param> + <param name="session">Session used to </param> + <exception cref="T:HttpServer.Exceptions.InternalServerException">Failed to find file extension</exception> + <exception cref="T:HttpServer.Exceptions.ForbiddenException">File type is forbidden.</exception> </member> - <member name="M:HttpServer.ConsoleLogWriter.GetColor(HttpServer.LogPrio)"> + <member name="M:HttpServer.HttpModules.FileModule.GetFileExtension(System.String)"> <summary> - Get color for the specified logprio + return a file extension from an absolute Uri path (or plain filename) </summary> - <param name="prio">prio for the log entry</param> - <returns>A <see cref="T:System.ConsoleColor"/> for the prio</returns> + <param name="uri"></param> + <returns></returns> </member> - <member name="T:HttpServer.NullLogWriter"> + <member name="P:HttpServer.HttpModules.FileModule.MimeTypes"> <summary> - Default log writer, writes everything to null (nowhere). + List with all mime-type that are allowed. </summary> - <seealso cref="T:HttpServer.ILogWriter"/> + <remarks>All other mime types will result in a Forbidden http status code.</remarks> </member> - <member name="F:HttpServer.NullLogWriter.Instance"> + <member name="P:HttpServer.HttpModules.FileModule.ForbiddenChars"> <summary> - The logging instance. + characters that may not exist in a path. </summary> + <example> + fileMod.ForbiddenChars = new string[]{ "\\", "..", ":" }; + </example> </member> - <member name="M:HttpServer.NullLogWriter.Write(System.Object,HttpServer.LogPrio,System.String)"> - <summary> - Writes everything to null - </summary> - <param name="source">object that wrote the logentry.</param> - <param name="prio">Importance of the log message</param> - <param name="message">The message.</param> + <member name="T:HttpServer.HttpForm"> + <summary>Container for posted form data</summary> </member> <member name="T:HttpServer.HttpInput"> <summary> @@ -2010,22 +1853,24 @@ <member name="M:HttpServer.HttpInput.Add(System.String,System.String)"> <summary> Add a new element. Form array elements are parsed - and added in a correct hierachy. + and added in a correct hierarchy. </summary> <param name="name">Name is converted to lower case.</param> <param name="value"></param> + <exception cref="T:System.ArgumentNullException"><c>name</c> is null.</exception> + <exception cref="T:System.InvalidOperationException">Cannot add stuff to <see cref="F:HttpServer.HttpInput.Empty"/>.</exception> </member> <member name="M:HttpServer.HttpInput.Contains(System.String)"> <summary> - Returns true if the class contains a HttpInput value with the corresponding name + Returns true if the class contains a <see cref="T:HttpServer.HttpInput"/> with the corresponding name. </summary> - <param name="name">The field/querystring name</param> + <param name="name">The field/query string name</param> <returns>True if the value exists</returns> </member> <member name="M:HttpServer.HttpInput.ParseItem(System.String,System.String)"> <summary> Parses an item and returns it. - This function is primarly used to parse array items as in user[name]. + This function is primarily used to parse array items as in user[name]. </summary> <param name="name"></param> <param name="value"></param> @@ -2087,3491 +1932,1858 @@ Get a form item. </summary> <param name="name"></param> - <returns>Returns HttpInputItem.Empty if item was not found.</returns> - </member> - <member name="T:HttpServer.HttpParam"> - <summary> - Returns item either from a form or a query string (checks them in that order) - </summary> + <returns>Returns <see cref="F:HttpServer.HttpInputItem.Empty"/> if item was not found.</returns> </member> - <member name="F:HttpServer.HttpParam.Empty"> - <summary> Representation of a non-initialized HttpParam </summary> + <member name="F:HttpServer.HttpForm.EmptyForm"> + <summary>Instance to help mark a non-initialized form</summary> </member> - <member name="M:HttpServer.HttpParam.#ctor(HttpServer.IHttpInput,HttpServer.IHttpInput)"> - <summary>Initialises the class to hold a value either from a post request or a querystring request</summary> + <member name="M:HttpServer.HttpForm.#ctor"> + <summary>Initializes a form container with the specified name</summary> </member> - <member name="M:HttpServer.HttpParam.Add(System.String,System.String)"> + <member name="M:HttpServer.HttpForm.#ctor(HttpServer.HttpInput)"> <summary> - The add method is not availible for HttpParam - since HttpParam checks both Request.Form and Request.QueryString + Makes a deep copy of the input </summary> - <param name="name">name identifying the value</param> - <param name="value">value to add</param> - <exception cref="T:System.NotImplementedException"></exception> + <param name="input">The input to copy</param> </member> - <member name="M:HttpServer.HttpParam.Contains(System.String)"> + <member name="M:HttpServer.HttpForm.AddFile(HttpServer.HttpFile)"> <summary> - Checks whether the form or querystring has the specified value + Adds a file to the collection of posted files </summary> - <param name="name">Name, case sensitive</param> - <returns>true if found; otherwise false.</returns> + <param name="file">The file to add</param> + <exception cref="T:System.ArgumentException">If the file is already added</exception> + <exception cref="T:System.ArgumentNullException">If file is null</exception> + <exception cref="T:System.InvalidOperationException">If the instance is HttpForm.EmptyForm which cannot be modified</exception> </member> - <member name="M:HttpServer.HttpParam.System#Collections#Generic#IEnumerable{HttpServer#HttpInputItem}#GetEnumerator"> + <member name="M:HttpServer.HttpForm.ContainsFile(System.String)"> <summary> - Returns an enumerator that iterates through the collection. + Checks if the form contains a specified file </summary> - - <returns> - A <see cref="T:System.Collections.Generic.IEnumerator`1"></see> that can be used to iterate through the collection. - </returns> - <filterpriority>1</filterpriority> + <param name="name">Field name of the file parameter</param> + <returns>True if the file exists</returns> + <exception cref="T:System.InvalidOperationException">If the instance is HttpForm.EmptyForm which cannot be modified</exception> </member> - <member name="M:HttpServer.HttpParam.GetEnumerator"> + <member name="M:HttpServer.HttpForm.GetFile(System.String)"> <summary> - Returns an enumerator that iterates through a collection. + Retrieves a file held by by the form </summary> - - <returns> - An <see cref="T:System.Collections.IEnumerator"></see> object that can be used to iterate through the collection. - </returns> - <filterpriority>2</filterpriority> + <param name="name">The identifier of the file</param> + <returns>The requested file or null if the file was not found</returns> + <exception cref="T:System.ArgumentNullException">If name is null or empty</exception> + <exception cref="T:System.InvalidOperationException">If the instance is HttpForm.EmptyForm which cannot be modified</exception> </member> - <member name="P:HttpServer.HttpParam.Item(System.String)"> + <member name="M:HttpServer.HttpForm.Clear"> + <summary>Disposes all held HttpFile's and resets values</summary> + </member> + <member name="P:HttpServer.HttpForm.Files"> <summary> - Fetch an item from the form or querystring (in that order). + Retrieves the number of files added to the <see cref="T:HttpServer.HttpForm"/> </summary> - <param name="name"></param> - <returns>Item if found; otherwise HttpInputItem.EmptyLanguageNode</returns> + <returns>0 if no files are added</returns> </member> - <member name="T:HttpServer.HttpFile"> + <member name="T:HttpServer.Check"> <summary> - Container class for posted files + Small design by contract implementation. </summary> </member> - <member name="M:HttpServer.HttpFile.#ctor(System.String,System.String,System.String,System.String)"> + <member name="M:HttpServer.Check.NotEmpty(System.String,System.String)"> <summary> - Creates a container for a posted file + Check whether a parameter is empty. </summary> - <param name="name">The identifier of the post field</param> - <param name="filename">The file path</param> - <param name="contentType">The content type of the file</param> - <param name="uploadFilename">The name of the file uploaded</param> - <exception cref="T:System.ArgumentNullException">If any parameter is null or empty</exception> + <param name="value">Parameter value</param> + <param name="parameterOrErrorMessage">Parameter name, or error description.</param> + <exception cref="T:System.ArgumentException">value is empty.</exception> </member> - <member name="M:HttpServer.HttpFile.#ctor(System.String,System.String,System.String)"> + <member name="M:HttpServer.Check.Require(System.Object,System.String)"> <summary> - Creates a container for a posted file <see cref="M:HttpServer.HttpFile.#ctor(System.String,System.String,System.String,System.String)"/> + Checks whether a parameter is null. </summary> - <exception cref="T:System.ArgumentNullException">If any parameter is null or empty</exception> - </member> - <member name="M:HttpServer.HttpFile.Finalize"> - <summary>Destructor disposing the file</summary> + <param name="value">Parameter value</param> + <param name="parameterOrErrorMessage">Parameter name, or error description.</param> + <exception cref="T:System.ArgumentNullException">value is null.</exception> </member> - <member name="M:HttpServer.HttpFile.Dispose(System.Boolean)"> + <member name="M:HttpServer.Check.Min(System.Int32,System.Object,System.String)"> <summary> - Deletes the temporary file + Checks whether a parameter is null. </summary> - <param name="disposing">True if manual dispose</param> + <param name="minValue"></param> + <param name="value">Parameter value</param> + <param name="parameterOrErrorMessage">Parameter name, or error description.</param> + <exception cref="T:System.ArgumentException">value is null.</exception> </member> - <member name="M:HttpServer.HttpFile.Dispose"> + <member name="T:HttpServer.Authentication.BasicAuthentication"> <summary> - Disposing interface, cleans up managed resources (the temporary file) and suppresses finalization + The "basic" authentication scheme is based on the model that the + client must authenticate itself with a user-ID and a password for + each realm. The realm value should be considered an opaque string + which can only be compared for equality with other realms on that + server. The server will service the request only if it can validate + the user-ID and password for the protection space of the Request-URI. + There are no optional authentication parameters. </summary> </member> - <member name="P:HttpServer.HttpFile.Name"> + <member name="M:HttpServer.Authentication.BasicAuthentication.#ctor(HttpServer.Authentication.AuthenticationHandler,HttpServer.Authentication.AuthenticationRequiredHandler)"> <summary> - The name/id of the file + Initializes a new instance of the <see cref="T:HttpServer.Authentication.BasicAuthentication"/> class. </summary> + <param name="authenticator">Delegate used to provide information used during authentication.</param> + <param name="authenticationRequiredHandler">Delegate used to determine if authentication is required (may be null).</param> </member> - <member name="P:HttpServer.HttpFile.Filename"> + <member name="M:HttpServer.Authentication.BasicAuthentication.#ctor(HttpServer.Authentication.AuthenticationHandler)"> <summary> - The full file path + Initializes a new instance of the <see cref="T:HttpServer.Authentication.BasicAuthentication"/> class. </summary> + <param name="authenticator">Delegate used to provide information used during authentication.</param> </member> - <member name="P:HttpServer.HttpFile.UploadFilename"> + <member name="M:HttpServer.Authentication.BasicAuthentication.CreateResponse(System.String,System.Object[])"> <summary> - The name of the uploaded file + Create a response that can be sent in the WWW-Authenticate header. </summary> + <param name="realm">Realm that the user should authenticate in</param> + <param name="options">Not used in basic auth</param> + <returns>A correct auth request.</returns> </member> - <member name="P:HttpServer.HttpFile.ContentType"> + <member name="M:HttpServer.Authentication.BasicAuthentication.Authenticate(System.String,System.String,System.String,System.Object[])"> <summary> - The type of file + An authentication response have been received from the web browser. + Check if it's correct </summary> + <param name="authenticationHeader">Contents from the Authorization header</param> + <param name="realm">Realm that should be authenticated</param> + <param name="httpVerb">GET/POST/PUT/DELETE etc.</param> + <param name="options">Not used in basic auth</param> + <returns>Authentication object that is stored for the request. A user class or something like that.</returns> + <exception cref="T:System.ArgumentException">if authenticationHeader is invalid</exception> + <exception cref="T:System.ArgumentNullException">If any of the paramters is empty or null.</exception> </member> - <member name="T:HttpServer.Helpers.ObjectForm"> + <member name="P:HttpServer.Authentication.BasicAuthentication.Name"> <summary> - The object form class takes an object and creates form items for it. + name used in http request. </summary> </member> - <member name="M:HttpServer.Helpers.ObjectForm.#ctor(System.String,System.String,System.Object,System.String)"> + <member name="T:HttpServer.Rules.IRule"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Helpers.ObjectForm"/> class. + Rules are used to perform operations before a request is being handled. + Rules can be used to create routing etc. </summary> - <param name="method"></param> - <param name="name">form name *and* id.</param> - <param name="action">action to do when form is posted.</param> - <param name="obj"></param> </member> - <member name="M:HttpServer.Helpers.ObjectForm.#ctor(System.String,System.String,System.Object)"> + <member name="M:HttpServer.Rules.IRule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Helpers.ObjectForm"/> class. + Process the incoming request. </summary> - <param name="name">form name *and* id.</param> - <param name="action">action to do when form is posted.</param> - <param name="obj">object to get values from</param> + <param name="request">incoming HTTP request</param> + <param name="response">outgoing HTTP response</param> + <returns>true if response should be sent to the browser directly (no other rules or modules will be processed).</returns> + <remarks> + returning true means that no modules will get the request. Returning true is typically being done + for redirects. + </remarks> + <exception cref="T:System.ArgumentNullException">If request or response is null.</exception> </member> - <member name="M:HttpServer.Helpers.ObjectForm.#ctor(System.String,System.Object)"> + <member name="T:HttpServer.Helpers.GetIdTitle"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Helpers.ObjectForm"/> class. + Delegate used by <see cref="M:HttpServer.Helpers.FormHelper.Select(System.String,System.Collections.IEnumerable,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"/> to populate select options. </summary> - <param name="action">form action.</param> - <param name="obj">object to get values from.</param> + <param name="obj">current object (for instance a User).</param> + <param name="id">Text that should be displayed in the value part of a <optiongt;-tag.</param> + <param name="title">Text shown in the select list.</param> + <example> + // Class that is going to be used in a SELECT-tag. + public class User + { + private readonly string _realName; + private readonly int _id; + public User(int id, string realName) + { + _id = id; + _realName = realName; + } + public string RealName + { + get { return _realName; } + } + + public int Id + { + get { return _id; } + } + } + + // Using an inline delegate to generate the select list + public void UserInlineDelegate() + { + List<User> items = new List<User>(); + items.Add(new User(1, "adam")); + items.Add(new User(2, "bertial")); + items.Add(new User(3, "david")); + string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value) + { + User user = (User)o; + id = user.Id; + value = user.RealName; + }, 2, true); + } + + // Using an method as delegate to generate the select list. + public void UseExternalDelegate() + { + List<User> items = new List<User>(); + items.Add(new User(1, "adam")); + items.Add(new User(2, "bertial")); + items.Add(new User(3, "david")); + string htmlSelect = Select("users", "users", items, UserOptions, 1, true); + } + + // delegate returning id and title + public static void UserOptions(object o, out object id, out object title) + { + User user = (User)o; + id = user.Id; + value = user.RealName; + } /// </example> </member> - <member name="M:HttpServer.Helpers.ObjectForm.Begin"> + <member name="T:HttpServer.RequestCookies"> <summary> - write out the FORM-tag. + This class is created as a wrapper, since there are two different cookie types in .Net (Cookie and HttpCookie). + The framework might switch class in the future and we dont want to have to replace all instances </summary> - <returns>generated html code</returns> </member> - <member name="M:HttpServer.Helpers.ObjectForm.Begin(System.Boolean)"> + <member name="M:HttpServer.RequestCookies.#ctor(System.String)"> <summary> - Writeout the form tag + Let's copy all the cookies. </summary> - <param name="isAjax">form should be posted through ajax.</param> - <returns>generated html code</returns> + <param name="cookies">value from cookie header.</param> </member> - <member name="M:HttpServer.Helpers.ObjectForm.Tb(System.String,System.Object[])"> + <member name="M:HttpServer.RequestCookies.Add(HttpServer.RequestCookie)"> <summary> - Generates a text box. + Adds a cookie in the collection. </summary> - <param name="propertyName"></param> - <param name="options"></param> - <returns>generated html code</returns> + <param name="cookie">cookie to add</param> + <exception cref="T:System.ArgumentNullException">cookie is null</exception> </member> - <member name="M:HttpServer.Helpers.ObjectForm.Pb(System.String,System.Object[])"> + <member name="M:HttpServer.RequestCookies.GetEnumerator"> <summary> - password box + Gets a collection enumerator on the cookie list. </summary> - <param name="propertyName"></param> - <param name="options"></param> - <returns>generated html code</returns> + <returns>collection enumerator</returns> </member> - <member name="M:HttpServer.Helpers.ObjectForm.Hidden(System.String,System.Object[])"> + <member name="M:HttpServer.RequestCookies.Clear"> <summary> - Hiddens the specified property name. + Remove all cookies. </summary> - <param name="propertyName">Name of the property.</param> - <param name="options">The options.</param> - <returns>generated html code</returns> </member> - <member name="M:HttpServer.Helpers.ObjectForm.Label(System.String,System.String)"> + <member name="M:HttpServer.RequestCookies.System#Collections#Generic#IEnumerable{HttpServer#RequestCookie}#GetEnumerator"> <summary> - Labels the specified property name. + Returns an enumerator that iterates through the collection. </summary> - <param name="propertyName">property in object.</param> - <param name="label">caption</param> - <returns>generated html code</returns> + + <returns> + A <see cref="T:System.Collections.Generic.IEnumerator`1"></see> that can be used to iterate through the collection. + </returns> + <filterpriority>1</filterpriority> </member> - <member name="M:HttpServer.Helpers.ObjectForm.Cb(System.String,System.String,System.Object[])"> + <member name="M:HttpServer.RequestCookies.Remove(System.String)"> <summary> - Generate a checkbox + Remove a cookie from the collection. </summary> - <param name="propertyName">property in object</param> - <param name="value">checkbox value</param> - <param name="options">additional html attributes.</param> - <returns>generated html code</returns> + <param name="cookieName">Name of cookie.</param> </member> - <member name="M:HttpServer.Helpers.ObjectForm.Select(System.String,System.String,System.String,System.Object[])"> + <member name="P:HttpServer.RequestCookies.Count"> <summary> - Write a html select tag + Gets the count of cookies in the collection. </summary> - <param name="propertyName">object property.</param> - <param name="idColumn">id column</param> - <param name="titleColumn">The title column.</param> - <param name="options">The options.</param> - <returns></returns> </member> - <member name="M:HttpServer.Helpers.ObjectForm.Select(System.String,System.Collections.IEnumerable,System.String,System.String,System.Object[])"> + <member name="P:HttpServer.RequestCookies.Item(System.String)"> <summary> - Selects the specified property name. + Gets the cookie of a given identifier (null if not existing). </summary> - <param name="propertyName">Name of the property.</param> - <param name="items">The items.</param> - <param name="idColumn">The id column.</param> - <param name="titleColumn">The title column.</param> - <param name="options">The options.</param> - <returns></returns> </member> - <member name="M:HttpServer.Helpers.ObjectForm.Submit(System.String)"> + <member name="T:HttpServer.Exceptions.BadRequestException"> <summary> - Write a submit tag. + The request could not be understood by the server due to malformed syntax. + The client SHOULD NOT repeat the request without modifications. + + Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php </summary> - <param name="value">button caption</param> - <returns>html submit tag</returns> </member> - <member name="M:HttpServer.Helpers.ObjectForm.End"> + <member name="M:HttpServer.Exceptions.BadRequestException.#ctor(System.String)"> <summary> - html end form tag + Create a new bad request exception. </summary> - <returns>html</returns> + <param name="errMsg">reason to why the request was bad.</param> </member> - <member name="T:HttpServer.FormDecoders.FormDecoderProvider"> + <member name="M:HttpServer.Exceptions.BadRequestException.#ctor(System.String,System.Exception)"> <summary> - This provider is used to let us implement any type of form decoding we want without - having to rewrite anything else in the server. + Create a new bad request exception. </summary> + <param name="errMsg">reason to why the request was bad.</param> + <param name="inner">inner exception</param> </member> - <member name="M:HttpServer.FormDecoders.FormDecoderProvider.Decode(System.String,System.IO.Stream,System.Text.Encoding)"> - <summary> - - </summary> - <param name="contentType">Should contain boundary and type, as in: multipart/form-data; boundary=---------------------------230051238959</param> - <param name="stream">Stream containg form data.</param> - <param name="encoding">Encoding used when decoding the stream</param> - <returns>HttpInput.EmptyLanguageNode if no parser was found. Must always return something (HttpInput.Empty instead of null)</returns> - <exception cref="T:System.ArgumentException">If stream is null or not readable.</exception> - <exception cref="T:System.IO.InvalidDataException">If stream contents cannot be decoded properly.</exception> - </member> - <member name="M:HttpServer.FormDecoders.FormDecoderProvider.Add(HttpServer.FormDecoders.IFormDecoder)"> - <summary> - Add a decoder. - </summary> - <param name="decoder"></param> - <exception cref="T:System.ArgumentNullException"></exception> - </member> - <member name="P:HttpServer.FormDecoders.FormDecoderProvider.Count"> + <member name="T:HttpServer.Sessions.IHttpSessionStore"> <summary> - Number of added decoders. + A session store is used to store and load sessions on a media. + The default implementation (<see cref="T:HttpServer.Sessions.MemorySessionStore"/>) saves/retrieves sessions from memory. </summary> </member> - <member name="P:HttpServer.FormDecoders.FormDecoderProvider.Decoders"> + <member name="M:HttpServer.Sessions.IHttpSessionStore.Create"> <summary> - Use with care. + Creates a new http session with a generated id. </summary> + <returns>A <see cref="T:HttpServer.Sessions.IHttpSession"/> object</returns> </member> - <member name="P:HttpServer.FormDecoders.FormDecoderProvider.DefaultDecoder"> + <member name="M:HttpServer.Sessions.IHttpSessionStore.Create(System.String)"> <summary> - Decoder used for unknown content types. + Creates a new http session with a specific id </summary> + <param name="id">Id used to identify the new cookie..</param> + <returns>A <see cref="T:HttpServer.Sessions.IHttpSession"/> object.</returns> + <remarks> + Id should be generated by the store implementation if it's null or <see cref="F:System.String.Empty"/>. + </remarks> </member> - <member name="T:HttpServer.Rendering.Haml.Rules.AttributesRule"> + <member name="M:HttpServer.Sessions.IHttpSessionStore.Load(System.String)"> <summary> - Contains an (html) attribute list. + Load an existing session. </summary> + <param name="sessionId">Session id (usually retrieved from a client side cookie).</param> + <returns>A session if found; otherwise null.</returns> </member> - <member name="T:HttpServer.Rendering.Haml.Rules.Rule"> + <member name="M:HttpServer.Sessions.IHttpSessionStore.Save(HttpServer.Sessions.IHttpSession)"> <summary> - Rules are used during preparse + Save an updated session to the store. </summary> + <param name="session">Session id (usually retrieved from a client side cookie).</param> + <exception cref="T:System.ArgumentException">If Id property have not been specified.</exception> </member> - <member name="M:HttpServer.Rendering.Haml.Rules.Rule.IsMultiLine(HttpServer.Rendering.Haml.LineInfo,System.Boolean)"> + <member name="M:HttpServer.Sessions.IHttpSessionStore.AddUnused(HttpServer.Sessions.IHttpSession)"> <summary> - Determines if this node spans over multiple lines. + We use the flyweight pattern which reuses small objects + instead of creating new each time. </summary> - <param name="line">contains line information (and text)</param> - <param name="isContinued">true if rule have previously inited a multiline.</param> - <returns>true if this line continues onto the next.</returns>/// + <param name="session">Unused session that should be reused next time Create is called.</param> </member> - <member name="M:HttpServer.Rendering.Haml.Rules.AttributesRule.IsMultiLine(HttpServer.Rendering.Haml.LineInfo,System.Boolean)"> + <member name="M:HttpServer.Sessions.IHttpSessionStore.Cleanup"> <summary> - Determines if this node spans over multiple lines. + Remove expired sessions </summary> - <param name="line">contains line information (and text)</param> - <param name="isContinued">true if the previous line was continued.</param> - <returns>true if this line continues onto the next.</returns> </member> - <member name="T:HttpServer.Rendering.Haml.Nodes.TextNode"> + <member name="M:HttpServer.Sessions.IHttpSessionStore.Remove(System.String)"> <summary> - A text only node. + Remove a session </summary> + <param name="sessionId">id of the session.</param> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.TextNode.#ctor(HttpServer.Rendering.Haml.Nodes.Node,System.String)"> + <member name="P:HttpServer.Sessions.IHttpSessionStore.Item(System.String)"> <summary> - + Load a session from the store </summary> - <param name="parent">parent node</param> - <param name="text">plain text</param> + <param name="sessionId"></param> + <returns>null if session is not found.</returns> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.TextNode.Parse(HttpServer.Rendering.Haml.NodeList,HttpServer.Rendering.Haml.Nodes.Node,HttpServer.Rendering.Haml.LineInfo,System.Int32@)"> + <member name="P:HttpServer.Sessions.IHttpSessionStore.ExpireTime"> <summary> - Parse node contents add return a fresh node. + Number of minutes before a session expires. </summary> - <param name="prototypes">List containing all node types</param> - <param name="parent">Node that this is a subnode to. Can be null</param> - <param name="line">Line to parse</param> - <param name="offset">Where to start the parsing. Should be set to where the next node should start parsing.</param> - <returns>A node corresponding to the bla bla; null if parsing failed.</returns> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException"></exception> + <value>Default time is 20 minutes.</value> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.TextNode.CanHandle(System.String,System.Boolean)"> + <member name="T:HttpServer.IHttpClientContext"> <summary> - determines if this node can handle the line (by checking the first word); + Contains a connection to a browser/client. </summary> - <param name="word">Controller char (word)</param> - <returns>true if text belongs to this node type</returns> - <param name="firstNode">true if this is the first node on the line.</param> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.TextNode.ToHtml"> + <member name="M:HttpServer.IHttpClientContext.Disconnect(System.Net.Sockets.SocketError)"> <summary> - Generate HTML for this node. + Disconnect from client </summary> - <returns></returns> + <param name="error">error to report in the <see cref="E:HttpServer.IHttpClientContext.Disconnected"/> event.</param> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.TextNode.ToCode(System.Boolean@,System.Boolean,System.Boolean)"> + <member name="M:HttpServer.IHttpClientContext.Respond(System.String,System.Net.HttpStatusCode,System.String,System.String,System.String)"> <summary> - Convert the node to c# code + Send a response. </summary> - <param name="inString">True if we are inside the internal stringbuilder</param> - <param name="smallEnough">true if all subnodes fit on one line</param> - <param name="smallEnoughIsDefaultValue">todo: add description</param> - <returns>c# code</returns> + <param name="httpVersion">Either <see cref="F:HttpServer.HttpHelper.HTTP10"/> or <see cref="F:HttpServer.HttpHelper.HTTP11"/></param> + <param name="statusCode">HTTP status code</param> + <param name="reason">reason for the status code.</param> + <param name="body">HTML body contents, can be null or empty.</param> + <param name="contentType">A content type to return the body as, i.e. 'text/html' or 'text/plain', defaults to 'text/html' if null or empty</param> + <exception cref="T:System.ArgumentException">If <paramref name="httpVersion"/> is invalid.</exception> </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.TextNode.Text"> + <member name="M:HttpServer.IHttpClientContext.Respond(System.String,System.Net.HttpStatusCode,System.String)"> <summary> - The text. + Send a response. </summary> + <param name="httpVersion">Either <see cref="F:HttpServer.HttpHelper.HTTP10"/> or <see cref="F:HttpServer.HttpHelper.HTTP11"/></param> + <param name="statusCode">HTTP status code</param> + <param name="reason">reason for the status code.</param> </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.TextNode.IsTextNode"> + <member name="M:HttpServer.IHttpClientContext.Respond(System.String)"> <summary> - Is this a text node (containing plain text)? + Send a response. </summary> + <exception cref="T:System.ArgumentNullException"></exception> </member> - <member name="T:HttpServer.HttpModules.ResourceFileModule"> + <member name="M:HttpServer.IHttpClientContext.Send(System.Byte[])"> <summary> - Serves files that are stored in embedded resources. + send a whole buffer </summary> + <param name="buffer">buffer to send</param> + <exception cref="T:System.ArgumentNullException"></exception> </member> - <member name="M:HttpServer.HttpModules.ResourceFileModule.#ctor"> + <member name="M:HttpServer.IHttpClientContext.Send(System.Byte[],System.Int32,System.Int32)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.HttpModules.ResourceFileModule"/> class. - Runs <see cref="M:HttpServer.HttpModules.ResourceFileModule.AddDefaultMimeTypes"/> to make sure the basic mime types are available, they can be cleared later - through the use of <see cref="P:HttpServer.HttpModules.ResourceFileModule.MimeTypes"/> if desired. + Send data using the stream </summary> + <param name="buffer">Contains data to send</param> + <param name="offset">Start position in buffer</param> + <param name="size">number of bytes to send</param> + <exception cref="T:System.ArgumentNullException"></exception> + <exception cref="T:System.ArgumentOutOfRangeException"></exception> </member> - <member name="M:HttpServer.HttpModules.ResourceFileModule.AddDefaultMimeTypes"> + <member name="P:HttpServer.IHttpClientContext.Secured"> <summary> - Mimtypes that this class can handle per default + Using SSL or other encryption method. </summary> </member> - <member name="M:HttpServer.HttpModules.ResourceFileModule.AddResources(System.String,System.Reflection.Assembly,System.String)"> + <member name="P:HttpServer.IHttpClientContext.IsSecured"> <summary> - Loads resources from a namespace in the given assembly to an uri + Using SSL or other encryption method. </summary> - <param name="toUri">The uri to map the resources to</param> - <param name="fromAssembly">The assembly in which the resources reside</param> - <param name="fromNamespace">The namespace from which to load the resources</param> - <usage> - resourceLoader.LoadResources("/user/", typeof(User).Assembly, "MyLib.Models.User.Views"); - - will make ie the resource MyLib.Models.User.Views.stylesheet.css accessible via /user/stylesheet.css - </usage> </member> - <member name="M:HttpServer.HttpModules.ResourceFileModule.CanHandle(HttpServer.IHttpRequest)"> + <member name="E:HttpServer.IHttpClientContext.Disconnected"> <summary> - Returns true if the module can handle the request + The context have been disconnected. </summary> + <remarks> + Event can be used to clean up a context, or to reuse it. + </remarks> </member> - <member name="M:HttpServer.HttpModules.ResourceFileModule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> + <member name="E:HttpServer.IHttpClientContext.RequestReceived"> <summary> - Method that process the url + A request have been received in the context. </summary> - <param name="request">Information sent by the browser about the request</param> - <param name="response">Information that is being sent back to the client.</param> - <param name="session">Session used to </param> - <returns>true if this module handled the request.</returns> </member> - <member name="P:HttpServer.HttpModules.ResourceFileModule.MimeTypes"> + <member name="T:HttpServer.DisconnectedEventArgs"> <summary> - List with all mime-type that are allowed. + A <see cref="T:HttpServer.IHttpClientContext"/> have been disconnected. </summary> - <remarks>All other mime types will result in a Forbidden http status code.</remarks> </member> - <member name="T:HttpServer.FormDecoders.XmlDecoder"> + <member name="M:HttpServer.DisconnectedEventArgs.#ctor(System.Net.Sockets.SocketError)"> <summary> - This decoder converts XML documents to form items. - Each element becomes a subitem in the form, and each attribute becomes an item. + Initializes a new instance of the <see cref="T:HttpServer.DisconnectedEventArgs"/> class. </summary> - <example> - // xml: <hello id="1">something<world id="2">data</world></hello> - // result: - // form["hello"].Value = "something" - // form["hello"]["id"].Value = 1 - // form["hello"]["world]["id"].Value = 1 - // form["hello"]["world"].Value = "data" - </example> - <remarks> - The original xml document is stored in form["__xml__"].Value. - </remarks> + <param name="error">Reason to disconnection.</param> </member> - <member name="T:HttpServer.FormDecoders.IFormDecoder"> + <member name="P:HttpServer.DisconnectedEventArgs.Error"> <summary> - Interface for form content decoders. + Gets reason to why client disconnected. </summary> </member> - <member name="M:HttpServer.FormDecoders.IFormDecoder.Decode(System.IO.Stream,System.String,System.Text.Encoding)"> + <member name="T:HttpServer.RequestEventArgs"> <summary> </summary> - <param name="stream">Stream containing the content</param> - <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case</param> - <param name="encoding">Stream enconding</param> - <returns>A http form, or null if content could not be parsed.</returns> - <exception cref="T:System.IO.InvalidDataException">If contents in the stream is not valid input data.</exception> </member> - <member name="M:HttpServer.FormDecoders.IFormDecoder.CanParse(System.String)"> + <member name="M:HttpServer.RequestEventArgs.#ctor(HttpServer.IHttpRequest)"> <summary> - Checks if the decoder can handle the mime type + Initializes a new instance of the <see cref="T:HttpServer.RequestEventArgs"/> class. </summary> - <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case.</param> - <returns>True if the decoder can parse the specified content type</returns> + <param name="request">The request.</param> </member> - <member name="M:HttpServer.FormDecoders.XmlDecoder.Decode(System.IO.Stream,System.String,System.Text.Encoding)"> + <member name="P:HttpServer.RequestEventArgs.Request"> <summary> - + Gets received request. </summary> - <param name="stream">Stream containing the content</param> - <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case</param> - <param name="encoding">Stream encoding</param> - Note: contentType and encoding are not used? - <returns>A http form, or null if content could not be parsed.</returns> - <exception cref="T:System.IO.InvalidDataException"></exception> </member> - <member name="M:HttpServer.FormDecoders.XmlDecoder.TraverseNode(HttpServer.IHttpInput,System.Xml.XmlNode)"> + <member name="T:HttpServer.ResponseCookie"> <summary> - Recursive function that will go through an xml element and store it's content - to the form item. + cookie being sent back to the browser. </summary> - <param name="item">(parent) Item in form that content should be added to.</param> - <param name="node">Node that should be parsed.</param> + <seealso cref="T:HttpServer.ResponseCookie"/> </member> - <member name="M:HttpServer.FormDecoders.XmlDecoder.CanParse(System.String)"> + <member name="T:HttpServer.RequestCookie"> <summary> - Checks if the decoder can handle the mime type + cookie sent by the client/browser </summary> - <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case.</param> - <returns>True if the decoder can parse the specified content type</returns> + <seealso cref="T:HttpServer.ResponseCookie"/> </member> - <member name="T:HttpServer.Controllers.ControllerNameAttribute"> + <member name="M:HttpServer.RequestCookie.#ctor(System.String,System.String)"> <summary> - This attribute can be used to map a controller to a specific url without using - the class name. + Constructor. </summary> + <param name="id">cookie identifier</param> + <param name="content">cookie content</param> + <exception cref="T:System.ArgumentNullException">id or content is null</exception> + <exception cref="T:System.ArgumentException">id is empty</exception> </member> - <member name="M:HttpServer.Controllers.ControllerNameAttribute.#ctor(System.String)"> + <member name="M:HttpServer.RequestCookie.ToString"> <summary> - Maps a controller to a url without using the controller name. + Gets the cookie HTML representation. </summary> - <remarks> - <para>Per default the class name is used to determine which url to handle. - For instance, "class UserController" or "class User" tells the framework that - the urls that starts with "/user" should be handled by that controller.</para> - <para>This attribute can be used to circumvent that.</para> - </remarks> - <param name="name">The name.</param> + <returns>cookie string</returns> </member> - <member name="P:HttpServer.Controllers.ControllerNameAttribute.Name"> + <member name="P:HttpServer.RequestCookie.Name"> <summary> - The name that the controller should use + Gets the cookie identifier. </summary> </member> - <member name="T:HttpServer.Sessions.IHttpSessionStore"> + <member name="P:HttpServer.RequestCookie.Value"> <summary> - A session store is used to store and load sessions on a media. - The default implementation (<see cref="T:HttpServer.Sessions.MemorySessionStore"/>) saves/retrieves sessions from memory. + Cookie value. Set to null to remove cookie. </summary> </member> - <member name="M:HttpServer.Sessions.IHttpSessionStore.Create"> + <member name="M:HttpServer.ResponseCookie.#ctor(System.String,System.String,System.DateTime)"> <summary> - Creates a new http session with a generated id. + Constructor. </summary> - <returns>A <see cref="T:HttpServer.Sessions.IHttpSession"/> object</returns> + <param name="id">cookie identifier</param> + <param name="content">cookie content</param> + <param name="expiresAt">cookie expiration date. Use DateTime.MinValue for session cookie.</param> + <exception cref="T:System.ArgumentNullException">id or content is null</exception> + <exception cref="T:System.ArgumentException">id is empty</exception> </member> - <member name="M:HttpServer.Sessions.IHttpSessionStore.Create(System.String)"> + <member name="M:HttpServer.ResponseCookie.#ctor(System.String,System.String,System.DateTime,System.String,System.String)"> <summary> - Creates a new http session with a specific id + Create a new cookie </summary> - <param name="id">Id used to identify the new cookie..</param> - <returns>A <see cref="T:HttpServer.Sessions.IHttpSession"/> object.</returns> - <remarks> - Id should be generated by the store implementation if it's null or <see cref="F:System.String.Empty"/>. - </remarks> + <param name="name">name identifying the cookie</param> + <param name="value">cookie value</param> + <param name="expires">when the cookie expires. Setting DateTime.MinValue will delete the cookie when the session is closed.</param> + <param name="path">Path to where the cookie is valid</param> + <param name="domain">Domain that the cookie is valid for.</param> </member> - <member name="M:HttpServer.Sessions.IHttpSessionStore.Load(System.String)"> + <member name="M:HttpServer.ResponseCookie.#ctor(HttpServer.RequestCookie,System.DateTime)"> <summary> - Load an existing session. + Create a new cookie </summary> - <param name="sessionId">Session id (usually retrieved from a client side cookie).</param> - <returns>A session if found; otherwise null.</returns> + <param name="cookie">Name and value will be used</param> + <param name="expires">when the cookie expires.</param> </member> - <member name="M:HttpServer.Sessions.IHttpSessionStore.Save(HttpServer.Sessions.IHttpSession)"> + <member name="M:HttpServer.ResponseCookie.ToString"> <summary> - Save an updated session to the store. + Gets the cookie HTML representation. </summary> - <param name="session">Session id (usually retrieved from a client side cookie).</param> - <exception cref="T:System.ArgumentException">If Id property have not been specified.</exception> + <returns>cookie string</returns> </member> - <member name="M:HttpServer.Sessions.IHttpSessionStore.AddUnused(HttpServer.Sessions.IHttpSession)"> + <member name="P:HttpServer.ResponseCookie.Expires"> <summary> - We use the flyweight pattern which reuses small objects - instead of creating new each time. + When the cookie expires. + DateTime.MinValue means that the cookie expires when the session do so. </summary> - <param name="session">Unused session that should be reused next time Create is called.</param> </member> - <member name="M:HttpServer.Sessions.IHttpSessionStore.Cleanup"> + <member name="P:HttpServer.ResponseCookie.Path"> <summary> - Remove expired sessions + Cookie is only valid under this path. </summary> </member> - <member name="M:HttpServer.Sessions.IHttpSessionStore.Remove(System.String)"> + <member name="T:HttpServer.Method"> <summary> - Remove a session + Contains all HTTP Methods (according to the HTTP 1.1 specification) + <para> + See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html + </para> </summary> - <param name="sessionId">id of the session.</param> </member> - <member name="P:HttpServer.Sessions.IHttpSessionStore.Item(System.String)"> + <member name="F:HttpServer.Method.Delete"> <summary> - Load a session from the store + The DELETE method requests that the origin server delete the resource identified by the Request-URI. </summary> - <param name="sessionId"></param> - <returns>null if session is not found.</returns> - </member> - <member name="P:HttpServer.Sessions.IHttpSessionStore.ExpireTime"> - <summary> - Number of minutes before a session expires. - </summary> - <value>Default time is 20 minutes.</value> - </member> - <member name="T:HttpServer.HttpListener"> - <summary> - HTTP Listener waits for HTTP connections and provide us with <see cref="T:System.Net.HttpListenerContext"/>s using the - <see cref="P:HttpServer.HttpListener.RequestHandler"/> delegate. - </summary> - </member> - <member name="M:HttpServer.HttpListener.#ctor(System.Net.IPAddress,System.Int32)"> - <summary> - Listen for regular HTTP connections - </summary> - <param name="address">IP Address to accept connections on</param> - <param name="port">TCP Port to listen on, default HTTP port is 80.</param> - </member> - <member name="M:HttpServer.HttpListener.#ctor(System.Net.IPAddress,System.Int32,System.Security.Cryptography.X509Certificates.X509Certificate)"> - <summary> - Launch HttpListener in SSL mode - </summary> - <param name="address">IP Address to accept connections on</param> - <param name="port">TCP Port to listen on, default HTTPS port is 443</param> - <param name="certificate">Certificate to use</param> - </member> - <member name="M:HttpServer.HttpListener.#ctor(System.Net.IPAddress,System.Int32,System.Security.Cryptography.X509Certificates.X509Certificate,System.Security.Authentication.SslProtocols)"> - <summary> - Launch HttpListener in SSL mode - </summary> - <param name="address">IP Address to accept connections on</param> - <param name="port">TCP Port to listen on, default HTTPS port is 443</param> - <param name="certificate">Certificate to use</param> - <param name="protocol">which HTTPS protocol to use, default is TLS.</param> + <remarks> + <para> + This method MAY be overridden by human intervention (or other means) on the origin server. + The client cannot be guaranteed that the operation has been carried out, even if the status code + returned from the origin server indicates that the action has been completed successfully. + </para> + <para> + However, the server SHOULD NOT indicate success unless, at the time the response is given, + it intends to delete the resource or move it to an inaccessible location. + </para> + <para> + A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, + 202 (Accepted) if the action has not yet been enacted, + or 204 (No Content) if the action has been enacted but the response does not include an entity. + </para> + <para> + If the request passes through a cache and the Request-URI identifies one or more currently cached entities, + those entries SHOULD be treated as stale. Responses to this method are not cacheable. + </para> + </remarks> </member> - <member name="M:HttpServer.HttpListener.Start(System.Int32)"> + <member name="F:HttpServer.Method.Get"> <summary> - Start listen for new connections + The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. </summary> - <param name="backlog">Number of connections that can stand in a queue to be accepted.</param> + <remarks> + <para> + If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the + entity in the response and not the source text of the process, unless that text happens to be the output of the process. + </para> + <para> + The semantics of the GET method change to a "conditional GET" if the request message includes an + If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. + A conditional GET method requests that the entity be transferred only under the circumstances described + by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network + usage by allowing cached entities to be refreshed without requiring multiple requests or transferring + data already held by the client. + </para> + </remarks> </member> - <member name="M:HttpServer.HttpListener.Stop"> + <member name="F:HttpServer.Method.Header"> <summary> - Stop the listener + The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. </summary> - <exception cref="T:System.Net.Sockets.SocketException"></exception> + <remarks> + The meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the + information sent in response to a GET request. This method can be used for obtaining meta information about + the entity implied by the request without transferring the entity-body itself. + + This method is often used for testing hypertext links for validity, accessibility, and recent modification. + </remarks> </member> - <member name="E:HttpServer.HttpListener.Accepted"> + <member name="F:HttpServer.Method.Options"> <summary> - A client have been accepted, but not handled, by the listener. + <para>The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI.</para> </summary> + <remarks> + <para>This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval.</para> + </remarks> </member> - <member name="P:HttpServer.HttpListener.DisconnectHandler"> + <member name="F:HttpServer.Method.Post"> <summary> - Invoked when a client disconnects + The POST method is used to request that the origin server accept the entity enclosed + in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. </summary> + <remarks> + POST is designed to allow a uniform method to cover the following functions: + <list type="bullet"> + <item> + Annotation of existing resources; + </item><item> + Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; + </item><item> + Providing a block of data, such as the result of submitting a form, to a data-handling process; + </item><item> + Extending a database through an append operation. + </item> + </list> + <para> + If a resource has been created on the origin server, the response SHOULD be 201 (Created) and + contain an entity which describes the status of the request and refers to the new resource, and a + Location header (see section 14.30). + </para> + <para> + The action performed by the POST method might not result in a resource that can be identified by a URI. + In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on + whether or not the response includes an entity that describes the result. + </para><para> + Responses to this method are not cacheable, unless the response includes appropriate Cache-Control + or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent + to retrieve a cacheable resource. + </para> + </remarks> </member> - <member name="P:HttpServer.HttpListener.LogWriter"> + <member name="F:HttpServer.Method.Put"> <summary> - Gives you a change to receive log entries for all internals of the HTTP library. + The PUT method requests that the enclosed entity be stored under the supplied Request-URI. </summary> <remarks> - You may not switch log writer after starting the listener. + <list type="bullet"> + <item> + If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a + modified version of the one residing on the origin server. + </item><item> + If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new + resource by the requesting user agent, the origin server can create the resource with that URI. + </item><item> + If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. + </item><item> + If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to + indicate successful completion of the request. + </item><item> + If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be + given that reflects the nature of the problem. + </item> + </list> + <para> + The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not + understand or implement and MUST return a 501 (Not Implemented) response in such cases. + </para> </remarks> </member> - <member name="P:HttpServer.HttpListener.RequestHandler"> + <member name="F:HttpServer.Method.Trace"> <summary> - This handler will be invoked each time a new connection is accepted. + The TRACE method is used to invoke a remote, application-layer loop- back of the request message. </summary> </member> - <member name="P:HttpServer.HttpListener.UseTraceLogs"> + <member name="T:HttpServer.Methods"> <summary> - True if we should turn on trace logs. + Contains all HTTP Methods (according to the HTTP 1.1 specification) + <para> + See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html + </para> </summary> </member> - <member name="E:HttpServer.HttpListener.ExceptionThrown"> + <member name="F:HttpServer.Methods.Delete"> <summary> - Let's to receive unhandled exceptions from the threads. + The DELETE method requests that the origin server delete the resource identified by the Request-URI. </summary> <remarks> - Exceptions will be thrown during debug mode if this event is not used, - exceptions will be printed to console and suppressed during release mode. + <para> + This method MAY be overridden by human intervention (or other means) on the origin server. + The client cannot be guaranteed that the operation has been carried out, even if the status code + returned from the origin server indicates that the action has been completed successfully. + </para> + <para> + However, the server SHOULD NOT indicate success unless, at the time the response is given, + it intends to delete the resource or move it to an inaccessible location. + </para> + <para> + A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, + 202 (Accepted) if the action has not yet been enacted, + or 204 (No Content) if the action has been enacted but the response does not include an entity. + </para> + <para> + If the request passes through a cache and the Request-URI identifies one or more currently cached entities, + those entries SHOULD be treated as stale. Responses to this method are not cacheable. + </para> </remarks> </member> - <member name="T:HttpServer.Helpers.Implementations.PrototypeImp"> + <member name="F:HttpServer.Methods.Get"> <summary> - PrototypeJS implementation of the javascript functions. + The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. </summary> + <remarks> + <para> + If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the + entity in the response and not the source text of the process, unless that text happens to be the output of the process. + </para> + <para> + The semantics of the GET method change to a "conditional GET" if the request message includes an + If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. + A conditional GET method requests that the entity be transferred only under the circumstances described + by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network + usage by allowing cached entities to be refreshed without requiring multiple requests or transferring + data already held by the client. + </para> + </remarks> </member> - <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.AjaxRequest(System.String,System.String[])"> + <member name="F:HttpServer.Methods.Header"> <summary> - Requests a url through ajax + The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. </summary> - <param name="url">url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself.</param> - <param name="options">optional options in format "key, value, key, value", used in JS request object. All keys should end with colon.</param> - <returns>a link tag</returns> - <remarks>onclick attribute is used by this method.</remarks> - <example> - <code> - // plain text - JSHelper.AjaxRequest("'/user/show/1'"); + <remarks> + The meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the + information sent in response to a GET request. This method can be used for obtaining meta information about + the entity implied by the request without transferring the entity-body itself. - // ajax request using this.href - string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>"; - </code> - </example> - </member> - <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.Contains(System.Collections.Generic.IEnumerable{System.String},System.String)"> - <summary> - Determins if a list of strings contains a specific value - </summary> - <param name="options">options to check in</param> - <param name="value">value to find</param> - <returns>true if value was found</returns> - <remarks>case insensitive</remarks> - </member> - <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.AjaxUpdater(System.String,System.String,System.String[])"> - <summary> - Ajax requests that updates an element with - the fetched content - </summary> - <param name="url">url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself.</param> - <param name="targetId">element to update</param> - <param name="options">options in format "key, value, key, value". All keys should end with colon.</param> - <returns>A link tag.</returns> - <example> - <code> - JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true"); - </code> - </example> + This method is often used for testing hypertext links for validity, accessibility, and recent modification. + </remarks> </member> - <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.DialogLink(System.String,System.String,System.String[])"> + <member name="F:HttpServer.Methods.Options"> <summary> - A link that pop ups a Dialog (overlay div) + <para>The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI.</para> </summary> - <param name="url">url to contents of dialog</param> - <param name="title">link title</param> - <param name="htmlAttributes">name, value, name, value</param> - <returns> - A "a"-tag that popups a dialog when clicked - </returns> - <remarks><para>Requires Control.Modal found here: http://livepipe.net/projects/control_modal/</para> - And the following javascript (load it in application.js): - <code> - Event.observe(window, 'load', - function() { - document.getElementsByClassName('modal').each(function(link){ new Control.Modal(link); }); - } - ); - </code> + <remarks> + <para>This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval.</para> </remarks> - <example> - WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); - </example> </member> - <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.CreateDialog(System.String,System.String,System.String[])"> + <member name="F:HttpServer.Methods.Post"> <summary> - create a modal dialog (usually using DIVs) + The POST method is used to request that the origin server accept the entity enclosed + in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. </summary> - <param name="url">url to fetch</param> - <param name="title">dialog title</param> - <param name="options">javascript/html attributes. javascript options ends with colon ':'.</param> - <returns></returns> - </member> - <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.CloseDialog"> - <summary> - Close a javascript dialog window/div. - </summary> - <returns>javascript for closing a dialog.</returns> - <see cref="M:HttpServer.Helpers.Implementations.PrototypeImp.DialogLink(System.String,System.String,System.String[])"/> - </member> - <member name="M:HttpServer.Helpers.Implementations.PrototypeImp.AjaxFormOnSubmit(System.String[])"> - <summary> - javascript action that should be added to the "onsubmit" event in the form tag. - </summary> - <param name="options">remember to encapsulate strings in ''</param> - <returns></returns> - <remarks>All javascript option names should end with colon.</remarks> - <example> - <code> - JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); - </code> - </example> - </member> - <member name="T:HttpServer.Exceptions.NotFoundException"> - <summary> - The requested resource was not found in the web server. - </summary> - </member> - <member name="T:HttpServer.Exceptions.HttpException"> - <summary> - All HTTP based exceptions will derive this class. - </summary> - </member> - <member name="M:HttpServer.Exceptions.HttpException.#ctor(System.Net.HttpStatusCode,System.String)"> - <summary> - Create a new HttpException - </summary> - <param name="code">http status code (sent in the response)</param> - <param name="message">error description</param> - </member> - <member name="M:HttpServer.Exceptions.HttpException.#ctor(System.Net.HttpStatusCode,System.String,System.Exception)"> - <summary> - Create a new HttpException - </summary> - <param name="code">http status code (sent in the response)</param> - <param name="message">error description</param> - <param name="inner">inner exception</param> - </member> - <member name="P:HttpServer.Exceptions.HttpException.HttpStatusCode"> - <summary> - status code to use in the response. - </summary> - </member> - <member name="M:HttpServer.Exceptions.NotFoundException.#ctor(System.String,System.Exception)"> - <summary> - Create a new exception - </summary> - <param name="message">message describing the error</param> - <param name="inner">inner exception</param> - </member> - <member name="M:HttpServer.Exceptions.NotFoundException.#ctor(System.String)"> - <summary> - Create a new exception - </summary> - <param name="message">message describing the error</param> - </member> - <member name="T:HttpServer.Controllers.RequestController"> - <summary> - A controller in the Model-View-Controller pattern. - Derive this class and add method with one of the following signatures: - "public string MethodName()" or "public void MyMethod()". - - The first should return a string with the response, the latter - should use SendHeader and SendBody methods to handle the response. - </summary> - <remarks> - Last segment of the path is always broken into the properties Id and RequestedType - Alhtough note that the RequestedType can also be empty if no file extension have - been specified. A typical use of file extensions in controllers is to specify which type of - format to return. - </remarks> - <example> - public class MyController : RequestController - { - public string Hello() - { - if (RequestedType == "xml") - return "<hello>World<hello>"; - else - return "Hello " + Request.QueryString["user"].Value + ", welcome to my world"; - } - - public void File() - { - Response.Headers.ContentType = "text/xml"; - Response.SendHeader(); - } - } - </example> - <seealso cref="T:HttpServer.Controllers.ControllerNameAttribute"/> - <seealso cref="T:HttpServer.Controllers.AuthRequiredAttribute"/> - <seealso cref="T:HttpServer.Controllers.AuthValidatorAttribute"/> - </member> - <member name="M:HttpServer.Controllers.RequestController.#ctor(HttpServer.Controllers.RequestController)"> - <summary> - create a new request controller - </summary> - <param name="controller">prototype to copy information from</param> - </member> - <member name="M:HttpServer.Controllers.RequestController.#ctor"> - <summary> - create a new controller - </summary> - </member> - <member name="M:HttpServer.Controllers.RequestController.CanHandle(HttpServer.IHttpRequest)"> - <summary> - Method that determines if an url should be handled or not by the module - </summary> - <param name="request">Url requested by the client.</param> - <returns>true if module should handle the url.</returns> - </member> - <member name="M:HttpServer.Controllers.RequestController.GetMethod(HttpServer.IHttpRequest)"> - <summary> - Determines which method to use. - </summary> - <param name="request">Requested resource</param> - </member> - <member name="M:HttpServer.Controllers.RequestController.InvokeBeforeFilters"> - <summary> - Call all before filters - </summary> - <returns>true if a before filter wants to abort the processing.</returns> - </member> - <member name="M:HttpServer.Controllers.RequestController.InvokeMethod"> - <summary> - Override this method to be able to process result - returned by controller method. - </summary> - </member> - <member name="M:HttpServer.Controllers.RequestController.OnUnhandledException(System.Exception)"> - <summary> - Override this method if you want to be able to - handle unhanded exceptions - </summary> - <param name="err">thrown exception</param> - <remarks>Don't "eat" exceptions derived from HttpException since - they are handled by the framework,unless your are sure of what you are - doing..</remarks> - </member> - <member name="M:HttpServer.Controllers.RequestController.MapMethods"> - <summary> - This method goes through all methods in the controller and - add's them to a dictionary. They are later used to invoke - the correct method depending on the url - </summary> - </member> - <member name="M:HttpServer.Controllers.RequestController.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> - <summary> - Method that process the url - </summary> - <param name="request">Uses Uri and QueryString to determine method.</param> - <param name="response">Relays response object to invoked method.</param> - <param name="session">Relays session object to invoked method. </param> - </member> - <member name="M:HttpServer.Controllers.RequestController.SetupRequest(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> - <summary> - Will assign all variables that are unique for each session - </summary> - <param name="request"></param> - <param name="response"></param> - <param name="session"></param> - </member> - <member name="M:HttpServer.Controllers.RequestController.Clone"> - <summary> - Make a clone of this controller - </summary> - <returns>a new controller with the same base information as this one.</returns> - </member> - <member name="P:HttpServer.Controllers.RequestController.AuthenticationTag"> - <summary> - object that was attached during http authentication process. - </summary> - <remarks> - You can also assign this tag yourself if you are using regular - http page login. - </remarks> - <seealso cref="T:HttpServer.Authentication.AuthModule"/> - </member> - <member name="P:HttpServer.Controllers.RequestController.ControllerName"> - <summary> - Name of this controller (class name without the "Controller" part) - </summary> - </member> - <member name="P:HttpServer.Controllers.RequestController.DefaultMethod"> - <summary> - Specifies the method to use if no action have been specified. - </summary> - <exception cref="T:System.ArgumentException">If specified method do not exist.</exception> - </member> - <member name="P:HttpServer.Controllers.RequestController.Id"> - <summary> - Id is the third part of the uri path. - </summary> - <remarks> - <para>Is extracted as in: /controllername/methodname/id/ - </para> - <para>string.Empty if not specified.</para> - </remarks> - <example></example> - </member> - <member name="P:HttpServer.Controllers.RequestController.MethodName"> - <summary> - Method currently being invoked. - Always in lower case. - </summary> - </member> - <member name="P:HttpServer.Controllers.RequestController.Request"> - <summary> - Request information (like Url, form, querystring etc) - </summary> - </member> - <member name="P:HttpServer.Controllers.RequestController.RequestedExtension"> - <summary> - Extension if a filename was specified. - </summary> - </member> - <member name="P:HttpServer.Controllers.RequestController.Response"> - <summary> - Response information (that is going to be sent back to the browser/client) - </summary> - </member> - <member name="P:HttpServer.Controllers.RequestController.Session"> - <summary> - Session information, is stored between requests as long as the session cookie is valid. - </summary> - </member> - <member name="T:HttpServer.Controllers.AuthRequiredAttribute"> - <summary> - Marks methods to let framework know that the method is protected - </summary> - <seealso cref="T:HttpServer.Controllers.AuthValidatorAttribute"/> - <seealso cref="T:HttpServer.Controllers.RequestController"/> - </member> - <member name="M:HttpServer.Controllers.AuthRequiredAttribute.#ctor"> - <summary> - Initializes a new instance of the <see cref="T:HttpServer.Controllers.AuthRequiredAttribute"/> class. - </summary> - </member> - <member name="M:HttpServer.Controllers.AuthRequiredAttribute.#ctor(System.Int32)"> - <summary> - - </summary> - <param name="level"> - Level is a value defined by you. It should be used to determine the users - that can access the method tagged with the AuthRequired attribute. - </param> - <example> - <![CDATA[ - public enum UserLevel - { - Guest, - User, - Admin, - SuperAdmin - } - public class UserController : RequestController - { - [AuthRequired(UserLevel.User)] - public string View() - { - return "Can also be viewed by users"; - } - - [AuthValidatorAttribute] - public bool ValidateUser(int level) - { - (User)user = Session["user"]; - return user != null && user.Status >= level; - } - } - ]]> - </example> - </member> - <member name="P:HttpServer.Controllers.AuthRequiredAttribute.Level"> - <summary> - Level is a value defined by you. It should be used to determine the users - that can access the method tagged with the AuthRequired attribute. - </summary> - </member> - <member name="T:HttpServer.Sessions.MemorySession"> - <summary> - A session stored in memory. - </summary> - </member> - <member name="T:HttpServer.Sessions.IHttpSession"> - <summary> - Interface for sessions - </summary> - </member> - <member name="M:HttpServer.Sessions.IHttpSession.Clear"> - <summary> - Remove everything from the session - </summary> - </member> - <member name="M:HttpServer.Sessions.IHttpSession.Clear(System.Boolean)"> - <summary> - Remove everything from the session - </summary> - <param name="expires">True if the session is cleared due to expiration</param> - </member> - <member name="P:HttpServer.Sessions.IHttpSession.Id"> - <summary> - Session id - </summary> - </member> - <member name="P:HttpServer.Sessions.IHttpSession.Item(System.String)"> - <summary> - Should - </summary> - <param name="name">Name of the session variable</param> - <returns>null if it's not set</returns> - <exception cref="T:System.Runtime.Serialization.SerializationException">If the object cant be serialized.</exception> - </member> - <member name="P:HttpServer.Sessions.IHttpSession.Accessed"> - <summary> - When the session was last accessed. - This property is touched by the http server each time the - session is requested. - </summary> - </member> - <member name="P:HttpServer.Sessions.IHttpSession.Count"> - <summary> - Number of session variables. - </summary> - </member> - <member name="E:HttpServer.Sessions.IHttpSession.BeforeClear"> - <summary> - Event triggered upon clearing the session - </summary> - </member> - <member name="M:HttpServer.Sessions.MemorySession.#ctor(System.String)"> - <summary> - - </summary> - <param name="id">A unique id used by the sessions store to identify the session</param> - </member> - <member name="M:HttpServer.Sessions.MemorySession.SetId(System.String)"> - <summary> - Id - </summary> - <param name="id"></param> - </member> - <member name="M:HttpServer.Sessions.MemorySession.Clear"> - <summary> - Remove everything from the session - </summary> - </member> - <member name="M:HttpServer.Sessions.MemorySession.Clear(System.Boolean)"> - <summary> - Clears the specified expire. - </summary> - <param name="expires">True if the session is cleared due to expiration</param> - </member> - <member name="M:HttpServer.Sessions.MemorySession.Dispose"> - <summary> - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - </summary> - <filterpriority>2</filterpriority> - </member> - <member name="P:HttpServer.Sessions.MemorySession.Id"> - <summary> - Session id - </summary> - </member> - <member name="P:HttpServer.Sessions.MemorySession.Item(System.String)"> - <summary> - Should - </summary> - <param name="name">Name of the session variable</param> - <returns>null if it's not set</returns> - </member> - <member name="P:HttpServer.Sessions.MemorySession.Accessed"> - <summary> - when the session was last accessed. - </summary> - <remarks> - Used to determine when the session should be removed. - </remarks> - </member> - <member name="P:HttpServer.Sessions.MemorySession.Count"> - <summary> - Number of values in the session - </summary> - </member> - <member name="P:HttpServer.Sessions.MemorySession.Changed"> - <summary> - Flag to indicate that the session have been changed - and should be saved into the session store. - </summary> - </member> - <member name="E:HttpServer.Sessions.MemorySession.BeforeClear"> - <summary> - Event triggered upon clearing the session - </summary> - </member> - <member name="T:HttpServer.Rendering.Haml.Rules.NewLineRule"> - <summary> - IRule that says that something :) - </summary> - </member> - <member name="M:HttpServer.Rendering.Haml.Rules.NewLineRule.IsMultiLine(HttpServer.Rendering.Haml.LineInfo,System.Boolean)"> - <summary> - Determines if this node spans over multiple lines. - </summary> - <param name="line">contains line information (and text)</param> - <param name="isContinued">true if the previous line was continued.</param> - <returns>true if this line continues onto the next.</returns> - </member> - <member name="T:HttpServer.Rendering.Haml.Nodes.TagNode"> - <summary> - Represents a HTML tag. - </summary> - </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.TagNode.#ctor(HttpServer.Rendering.Haml.Nodes.Node)"> - <summary> - Create a new HTML tag node. - </summary> - <param name="parent">parent node</param> - </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.TagNode.CanHandle(System.String,System.Boolean)"> - <summary> - determines if this node can handle the line (by checking the first word); - </summary> - <param name="word">Controller char (word)</param> - <returns>true if text belongs to this node type</returns> - <param name="firstNode">first node on line.</param> - </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.TagNode.Parse(HttpServer.Rendering.Haml.NodeList,HttpServer.Rendering.Haml.Nodes.Node,HttpServer.Rendering.Haml.LineInfo,System.Int32@)"> - <summary> - Parse node contents add return a fresh node. - </summary> - <param name="parent">Node that this is a subnode to. Can be null</param> - <param name="prototypes">A list with node types</param> - <param name="line">Line to parse</param> - <param name="offset">Where to start the parsing. Will be set to where the next node should start parsing</param> - <returns>A node corresponding to the bla bla; null if parsing failed.</returns> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException"></exception> - </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.TagNode.ToCode(System.Boolean@,System.Boolean,System.Boolean)"> - <summary> - Convert the node to c# code - </summary> - <param name="inString">True if we are inside the internal stringbuilder</param> - <param name="smallEnough">true if all subnodes fit on one line</param> - <param name="smallEnoughIsDefaultValue">smallEnough is a default value, recalc it</param> - <returns>c# code</returns> - </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.TagNode.ToHtml"> - <summary> - Convert node to HTML (with ASP-tags) - </summary> - <returns>HTML string</returns> - </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.TagNode.IsTextNode"> - <summary> - This is a plain text node - </summary> - </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.TagNode.Name"> - <summary> - tag name - </summary> - </member> - <member name="T:HttpServer.Rendering.TemplateException"> - <summary> - Thrown when a template cannot be compiled. - </summary> - </member> - <member name="M:HttpServer.Rendering.TemplateException.#ctor(System.String,Fadd.CompilerException)"> - <summary> - Initializes a new instance of the <see cref="T:HttpServer.Rendering.TemplateException"/> class. - </summary> - <param name="templateName">Template that failed compilation.</param> - <param name="err">Exception thrown by the compiler.</param> - </member> - <member name="M:HttpServer.Rendering.TemplateException.ToString"> - <summary> - Creates and returns a string representation of the current exception. - </summary> - <returns> - A string representation of the current exception. - </returns> - <PermissionSet> - <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" PathDiscovery="*AllFiles*"/> - </PermissionSet> - </member> - <member name="P:HttpServer.Rendering.TemplateException.Message"> - <summary> - Gets a message that describes the current exception. - </summary> - <value></value> - <returns> - The error message that explains the reason for the exception, or an empty string(""). - </returns> - </member> - <member name="T:HttpServer.Method"> - <summary> - Contains all HTTP Methods (according to the HTTP 1.1 specification) - <para> - See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html - </para> - </summary> - </member> - <member name="F:HttpServer.Method.Delete"> - <summary> - The DELETE method requests that the origin server delete the resource identified by the Request-URI. - </summary> - <remarks> - <para> - This method MAY be overridden by human intervention (or other means) on the origin server. - The client cannot be guaranteed that the operation has been carried out, even if the status code - returned from the origin server indicates that the action has been completed successfully. - </para> - <para> - However, the server SHOULD NOT indicate success unless, at the time the response is given, - it intends to delete the resource or move it to an inaccessible location. - </para> - <para> - A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, - 202 (Accepted) if the action has not yet been enacted, - or 204 (No Content) if the action has been enacted but the response does not include an entity. - </para> - <para> - If the request passes through a cache and the Request-URI identifies one or more currently cached entities, - those entries SHOULD be treated as stale. Responses to this method are not cacheable. - </para> - </remarks> - </member> - <member name="F:HttpServer.Method.Get"> - <summary> - The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. - </summary> - <remarks> - <para> - If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the - entity in the response and not the source text of the process, unless that text happens to be the output of the process. - </para> - <para> - The semantics of the GET method change to a "conditional GET" if the request message includes an - If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. - A conditional GET method requests that the entity be transferred only under the circumstances described - by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network - usage by allowing cached entities to be refreshed without requiring multiple requests or transferring - data already held by the client. - </para> - </remarks> - </member> - <member name="F:HttpServer.Method.Header"> - <summary> - The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. - </summary> - <remarks> - The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the - information sent in response to a GET request. This method can be used for obtaining metainformation about - the entity implied by the request without transferring the entity-body itself. - - This method is often used for testing hypertext links for validity, accessibility, and recent modification. - </remarks> - </member> - <member name="F:HttpServer.Method.Options"> - <summary> - <para>The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI.</para> - </summary> - <remarks> - <para>This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval.</para> - </remarks> - </member> - <member name="F:HttpServer.Method.Post"> - <summary> - The POST method is used to request that the origin server accept the entity enclosed - in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. - </summary> - <remarks> - POST is designed to allow a uniform method to cover the following functions: - <list type="bullet"> - <item> - Annotation of existing resources; - </item><item> - Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; - </item><item> - Providing a block of data, such as the result of submitting a form, to a data-handling process; - </item><item> - Extending a database through an append operation. - </item> - </list> - <para> - If a resource has been created on the origin server, the response SHOULD be 201 (Created) and - contain an entity which describes the status of the request and refers to the new resource, and a - Location header (see section 14.30). - </para> - <para> - The action performed by the POST method might not result in a resource that can be identified by a URI. - In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on - whether or not the response includes an entity that describes the result. - </para><para> - Responses to this method are not cacheable, unless the response includes appropriate Cache-Control - or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent - to retrieve a cacheable resource. - </para> - </remarks> - </member> - <member name="F:HttpServer.Method.Put"> - <summary> - The PUT method requests that the enclosed entity be stored under the supplied Request-URI. - </summary> - <remarks> - <list type="bullet"> - <item> - If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a - modified version of the one residing on the origin server. - </item><item> - If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new - resource by the requesting user agent, the origin server can create the resource with that URI. - </item><item> - If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. - </item><item> - If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to - indicate successful completion of the request. - </item><item> - If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be - given that reflects the nature of the problem. - </item> - </list> - <para> - The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not - understand or implement and MUST return a 501 (Not Implemented) response in such cases. - </para> - </remarks> - </member> - <member name="F:HttpServer.Method.Trace"> - <summary> - The TRACE method is used to invoke a remote, application-layer loop- back of the request message. - </summary> - </member> - <member name="T:HttpServer.Methods"> - <summary> - Contains all HTTP Methods (according to the HTTP 1.1 specification) - <para> - See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html - </para> - </summary> - </member> - <member name="F:HttpServer.Methods.Delete"> - <summary> - The DELETE method requests that the origin server delete the resource identified by the Request-URI. - </summary> - <remarks> - <para> - This method MAY be overridden by human intervention (or other means) on the origin server. - The client cannot be guaranteed that the operation has been carried out, even if the status code - returned from the origin server indicates that the action has been completed successfully. - </para> - <para> - However, the server SHOULD NOT indicate success unless, at the time the response is given, - it intends to delete the resource or move it to an inaccessible location. - </para> - <para> - A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, - 202 (Accepted) if the action has not yet been enacted, - or 204 (No Content) if the action has been enacted but the response does not include an entity. - </para> - <para> - If the request passes through a cache and the Request-URI identifies one or more currently cached entities, - those entries SHOULD be treated as stale. Responses to this method are not cacheable. - </para> - </remarks> - </member> - <member name="F:HttpServer.Methods.Get"> - <summary> - The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. - </summary> - <remarks> - <para> - If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the - entity in the response and not the source text of the process, unless that text happens to be the output of the process. - </para> - <para> - The semantics of the GET method change to a "conditional GET" if the request message includes an - If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. - A conditional GET method requests that the entity be transferred only under the circumstances described - by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network - usage by allowing cached entities to be refreshed without requiring multiple requests or transferring - data already held by the client. - </para> - </remarks> - </member> - <member name="F:HttpServer.Methods.Header"> - <summary> - The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. - </summary> - <remarks> - The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the - information sent in response to a GET request. This method can be used for obtaining metainformation about - the entity implied by the request without transferring the entity-body itself. - - This method is often used for testing hypertext links for validity, accessibility, and recent modification. - </remarks> - </member> - <member name="F:HttpServer.Methods.Options"> - <summary> - <para>The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI.</para> - </summary> - <remarks> - <para>This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval.</para> - </remarks> - </member> - <member name="F:HttpServer.Methods.Post"> - <summary> - The POST method is used to request that the origin server accept the entity enclosed - in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. - </summary> - <remarks> - POST is designed to allow a uniform method to cover the following functions: - <list type="bullet"> - <item> - Annotation of existing resources; - </item><item> - Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; - </item><item> - Providing a block of data, such as the result of submitting a form, to a data-handling process; - </item><item> - Extending a database through an append operation. - </item> - </list> - <para> - If a resource has been created on the origin server, the response SHOULD be 201 (Created) and - contain an entity which describes the status of the request and refers to the new resource, and a - Location header (see section 14.30). - </para> - <para> - The action performed by the POST method might not result in a resource that can be identified by a URI. - In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on - whether or not the response includes an entity that describes the result. - </para><para> - Responses to this method are not cacheable, unless the response includes appropriate Cache-Control - or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent - to retrieve a cacheable resource. - </para> - </remarks> - </member> - <member name="F:HttpServer.Methods.Put"> - <summary> - The PUT method requests that the enclosed entity be stored under the supplied Request-URI. - </summary> - <remarks> - <list type="bullet"> - <item> - If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a - modified version of the one residing on the origin server. - </item><item> - If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new - resource by the requesting user agent, the origin server can create the resource with that URI. - </item><item> - If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. - </item><item> - If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to - indicate successful completion of the request. - </item><item> - If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be - given that reflects the nature of the problem. - </item> - </list> - <para> - The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not - understand or implement and MUST return a 501 (Not Implemented) response in such cases. - </para> - </remarks> - </member> - <member name="F:HttpServer.Methods.Trace"> - <summary> - The TRACE method is used to invoke a remote, application-layer loop- back of the request message. - </summary> - </member> - <member name="T:HttpServer.IHttpRequest"> - <summary> - Contains serverside http request information. - </summary> - </member> - <member name="M:HttpServer.IHttpRequest.DecodeBody(HttpServer.FormDecoders.FormDecoderProvider)"> - <summary> - Decode body into a form. - </summary> - <param name="providers">A list with form decoders.</param> - <exception cref="T:System.IO.InvalidDataException">If body contents is not valid for the chosen decoder.</exception> - <exception cref="T:System.InvalidOperationException">If body is still being transferred.</exception> - </member> - <member name="M:HttpServer.IHttpRequest.SetCookies(HttpServer.RequestCookies)"> - <summary> - Sets the cookies. - </summary> - <param name="cookies">The cookies.</param> - </member> - <member name="M:HttpServer.IHttpRequest.AddHeader(System.String,System.String)"> - <summary> - Called during parsing of a IHttpRequest. - </summary> - <param name="name">Name of the header, should not be url encoded</param> - <param name="value">Value of the header, should not be url encoded</param> - <exception cref="T:HttpServer.Exceptions.BadRequestException">If a header is incorrect.</exception> - </member> - <member name="M:HttpServer.IHttpRequest.AddToBody(System.Byte[],System.Int32,System.Int32)"> - <summary> - Add bytes to the body - </summary> - <param name="bytes">buffer to read bytes from</param> - <param name="offset">where to start read</param> - <param name="length">number of bytes to read</param> - <returns>Number of bytes actually read (same as length unless we got all body bytes).</returns> - <exception cref="T:System.ArgumentException"></exception> - <exception cref="T:System.InvalidOperationException">If body is not writable</exception> - </member> - <member name="M:HttpServer.IHttpRequest.Clear"> - <summary> - Clear everything in the request - </summary> - </member> - <member name="P:HttpServer.IHttpRequest.BodyIsComplete"> - <summary> - Have all body content bytes been received? - </summary> - </member> - <member name="P:HttpServer.IHttpRequest.AcceptTypes"> - <summary> - Kind of types accepted by the client. - </summary> - </member> - <member name="P:HttpServer.IHttpRequest.Body"> - <summary> - Submitted body contents - </summary> - </member> - <member name="P:HttpServer.IHttpRequest.Connection"> - <summary> - Kind of connection used for the session. - </summary> - </member> - <member name="P:HttpServer.IHttpRequest.ContentLength"> - <summary> - Number of bytes in the body - </summary> - </member> - <member name="P:HttpServer.IHttpRequest.Headers"> - <summary> - Headers sent by the client. All names are in lower case. - </summary> - </member> - <member name="P:HttpServer.IHttpRequest.HttpVersion"> - <summary> - Version of http. - Probably HttpHelper.HTTP10 or HttpHelper.HTTP11 - </summary> - <seealso cref="T:HttpServer.HttpHelper"/> - </member> - <member name="P:HttpServer.IHttpRequest.Method"> - <summary> - Requested method, always upper case. - </summary> - <see cref="P:HttpServer.IHttpRequest.Method"/> - </member> - <member name="P:HttpServer.IHttpRequest.QueryString"> - <summary> - Variables sent in the query string - </summary> - </member> - <member name="P:HttpServer.IHttpRequest.Uri"> - <summary> - Requested URI (url) - </summary> - </member> - <member name="P:HttpServer.IHttpRequest.UriParts"> - <summary> - Uri absolute path splitted into parts. - </summary> - <example> - // uri is: http://gauffin.com/code/tiny/ - Console.WriteLine(request.UriParts[0]); // result: code - Console.WriteLine(request.UriParts[1]); // result: tiny - </example> - <remarks> - If you're using controllers than the first part is controller name, - the second part is method name and the third part is Id property. - </remarks> - <seealso cref="P:HttpServer.IHttpRequest.Uri"/> - </member> - <member name="P:HttpServer.IHttpRequest.Param"> - <summary> - Check's both QueryString and Form after the parameter. - </summary> - </member> - <member name="P:HttpServer.IHttpRequest.Form"> - <summary> - Form parameters. - </summary> - </member> - <member name="P:HttpServer.IHttpRequest.IsAjax"> - <summary>Returns true if the request was made by Ajax (Asyncronous Javascript)</summary> - </member> - <member name="P:HttpServer.IHttpRequest.Cookies"> - <summary>Returns set cookies for the request</summary> - </member> - <member name="T:HttpServer.HttpRequestParser"> - <summary> - Parses a HTTP request directly from a stream - </summary> - </member> - <member name="M:HttpServer.HttpRequestParser.#ctor(HttpServer.HttpRequestParser.RequestCompletedHandler,HttpServer.ILogWriter)"> - <summary> - Create a new request parser - </summary> - <param name="requestCompleted">delegate called when a complete request have been generated</param> - <param name="logWriter">delegate receiving log entries.</param> - </member> - <member name="M:HttpServer.HttpRequestParser.AddToBody(System.Byte[],System.Int32,System.Int32)"> - <summary> - Add a number of bytes to the body - </summary> - <param name="buffer"></param> - <param name="offset"></param> - <param name="count"></param> - <returns></returns> - </member> - <member name="M:HttpServer.HttpRequestParser.Clear"> - <summary> - Remove all state information for the request. - </summary> - </member> - <member name="M:HttpServer.HttpRequestParser.OnFirstLine(System.String)"> - <summary> - Parse request line - </summary> - <param name="value"></param> - <exception cref="T:HttpServer.Exceptions.BadRequestException">If line is incorrect</exception> - <remarks>Expects the following format: "Method SP Request-URI SP HTTP-Version CRLF"</remarks> - </member> - <member name="M:HttpServer.HttpRequestParser.OnHeader(System.String,System.String)"> - <summary> - We've parsed a new header. - </summary> - <param name="name">Name in lower case</param> - <param name="value">Value, unmodified.</param> - <exception cref="T:HttpServer.Exceptions.BadRequestException">If content length cannot be parsed.</exception> - </member> - <member name="M:HttpServer.HttpRequestParser.ParseMessage(System.Byte[],System.Int32,System.Int32)"> - <summary> - Parse a message - </summary> - <param name="buffer"></param> - <param name="offset">where in buffer that parsing should start</param> - <param name="size">number of bytes to parse</param> - <returns>Unparsed bytes left in buffer.</returns> - </member> - <member name="P:HttpServer.HttpRequestParser.CurrentState"> - <summary> - Current state in parser. - </summary> - </member> - <member name="T:HttpServer.HttpRequestParser.RequestCompletedHandler"> - <summary> - Invoked when a request have been completed. - </summary> - <param name="request"></param> - </member> - <member name="T:HttpServer.HttpRequestParser.State"> - <summary> - Current state in the parsing. - </summary> - </member> - <member name="F:HttpServer.HttpRequestParser.State.FirstLine"> - <summary> - Should parse the request line - </summary> - </member> - <member name="F:HttpServer.HttpRequestParser.State.HeaderName"> - <summary> - Searching for a complete header name - </summary> - </member> - <member name="F:HttpServer.HttpRequestParser.State.AfterName"> - <summary> - Searching for colon after header name (ignoring white spaces) - </summary> - </member> - <member name="F:HttpServer.HttpRequestParser.State.Between"> - <summary> - Searching for start of header value (ignoring white spaces) - </summary> - </member> - <member name="F:HttpServer.HttpRequestParser.State.HeaderValue"> - <summary> - Searching for a complete header value (can span over multiple lines, as long as they are prefixed with one/more whitespaces) - </summary> - </member> - <member name="F:HttpServer.HttpRequestParser.State.Body"> - <summary> - Adding bytes to body - </summary> - </member> - <member name="T:HttpServer.HttpRequest"> - <summary> - Contains serverside http request information. - </summary> - </member> - <member name="F:HttpServer.HttpRequest.UriSplitters"> - <summary> - Chars used to split an url path into multiple parts. - </summary> - </member> - <member name="M:HttpServer.HttpRequest.AssignForm(HttpServer.HttpForm)"> - <summary> - Assign a form. - </summary> - <param name="form"></param> - </member> - <member name="M:HttpServer.HttpRequest.Clone"> - <summary> - Creates a new object that is a copy of the current instance. - </summary> - - <returns> - A new object that is a copy of this instance. - </returns> - <filterpriority>2</filterpriority> - </member> - <member name="M:HttpServer.HttpRequest.DecodeBody(HttpServer.FormDecoders.FormDecoderProvider)"> - <summary> - Decode body into a form. - </summary> - <param name="providers">A list with form decoders.</param> - <exception cref="T:System.IO.InvalidDataException">If body contents is not valid for the chosen decoder.</exception> - <exception cref="T:System.InvalidOperationException">If body is still being transferred.</exception> - </member> - <member name="M:HttpServer.HttpRequest.SetCookies(HttpServer.RequestCookies)"> - <summary> - Cookies - </summary> - <param name="cookies">the cookies</param> - </member> - <member name="M:HttpServer.HttpRequest.AddHeader(System.String,System.String)"> - <summary> - Called during parsing of a IHttpRequest. - </summary> - <param name="name">Name of the header, should not be url encoded</param> - <param name="value">Value of the header, should not be url encoded</param> - <exception cref="T:HttpServer.Exceptions.BadRequestException">If a header is incorrect.</exception> - </member> - <member name="M:HttpServer.HttpRequest.AddToBody(System.Byte[],System.Int32,System.Int32)"> - <summary> - Add bytes to the body - </summary> - <param name="bytes">buffer to read bytes from</param> - <param name="offset">where to start read</param> - <param name="length">number of bytes to read</param> - <returns>Number of bytes actually read (same as length unless we got all body bytes).</returns> - <exception cref="T:System.ArgumentException"></exception> - <exception cref="T:System.InvalidOperationException">If body is not writable</exception> - </member> - <member name="M:HttpServer.HttpRequest.Clear"> - <summary> - Clear everything in the request - </summary> - </member> - <member name="P:HttpServer.HttpRequest.BodyIsComplete"> - <summary> - Have all body content bytes been received? - </summary> - </member> - <member name="P:HttpServer.HttpRequest.AcceptTypes"> - <summary> - Kind of types accepted by the client. - </summary> - </member> - <member name="P:HttpServer.HttpRequest.Body"> - <summary> - Submitted body contents - </summary> - </member> - <member name="P:HttpServer.HttpRequest.Connection"> - <summary> - Kind of connection used for the session. - </summary> - </member> - <member name="P:HttpServer.HttpRequest.ContentLength"> - <summary> - Number of bytes in the body - </summary> - </member> - <member name="P:HttpServer.HttpRequest.Headers"> - <summary> - Headers sent by the client. All names are in lower case. - </summary> - </member> - <member name="P:HttpServer.HttpRequest.HttpVersion"> - <summary> - Version of http. - Probably HttpHelper.HTTP10 or HttpHelper.HTTP11 - </summary> - <seealso cref="T:HttpServer.HttpHelper"/> - </member> - <member name="P:HttpServer.HttpRequest.Method"> - <summary> - Requested method, always upper case. - </summary> - <see cref="P:HttpServer.HttpRequest.Method"/> - </member> - <member name="P:HttpServer.HttpRequest.QueryString"> - <summary> - Variables sent in the query string - </summary> - </member> - <member name="P:HttpServer.HttpRequest.Uri"> - <summary> - Requested URI (url) - </summary> - <seealso cref="P:HttpServer.HttpRequest.UriPath"/> - </member> - <member name="P:HttpServer.HttpRequest.UriParts"> - <summary> - Uri absolute path splitted into parts. - </summary> - <example> - // uri is: http://gauffin.com/code/tiny/ - Console.WriteLine(request.UriParts[0]); // result: code - Console.WriteLine(request.UriParts[1]); // result: tiny - </example> - <remarks> - If you're using controllers than the first part is controller name, - the second part is method name and the third part is Id property. - </remarks> - <seealso cref="P:HttpServer.HttpRequest.Uri"/> - </member> - <member name="P:HttpServer.HttpRequest.UriPath"> - <summary> - Path and query (will be merged with the host header) and put in Uri - </summary> - <see cref="P:HttpServer.HttpRequest.Uri"/> - </member> - <member name="P:HttpServer.HttpRequest.Param"> - <summary> - Check's both QueryString and Form after the parameter. - </summary> - </member> - <member name="P:HttpServer.HttpRequest.Form"> - <summary> - Form parameters. - </summary> - </member> - <member name="P:HttpServer.HttpRequest.IsAjax"> - <summary>Returns true if the request was made by Ajax (Asyncronous Javascript)</summary> - </member> - <member name="P:HttpServer.HttpRequest.Cookies"> - <summary>Returns set cookies for the request</summary> - </member> - <member name="P:HttpServer.HttpRequest.Secure"> - <summary> - Current request is sent over secure protocol - </summary> - </member> - <member name="T:HttpServer.HttpModules.WebSiteModule"> - <summary> - The website module let's you handle multiple websites in the same server. - It uses the "Host" header to check which site you want. - </summary> - <remarks>It's recommended that you do not - add any other modules to HttpServer if you are using the website module. Instead, - add all wanted modules to each website.</remarks> - </member> - <member name="M:HttpServer.HttpModules.WebSiteModule.#ctor(System.String,System.String)"> - <summary> - - </summary> - <param name="host">domain name that should be handled.</param> - <param name="name"></param> - </member> - <member name="M:HttpServer.HttpModules.WebSiteModule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> - <summary> - Method that process the url - </summary> - <param name="request">Information sent by the browser about the request</param> - <param name="response">Information that is being sent back to the client.</param> - <param name="session">Session used to </param> - </member> - <member name="P:HttpServer.HttpModules.WebSiteModule.SiteName"> - <summary> - Name of site. - </summary> - </member> - <member name="T:HttpServer.Helpers.FormHelper"> - <summary> - Helpers making it easier to work with forms. - </summary> - <seealso cref="T:HttpServer.Helpers.ObjectForm"/> - </member> - <member name="F:HttpServer.Helpers.FormHelper.JSImplementation"> - <summary> - Used to let the website use different javascript libraries. - Default is <see cref="T:HttpServer.Helpers.Implementations.PrototypeImp"/> - </summary> - </member> - <member name="M:HttpServer.Helpers.FormHelper.Start(System.String,System.String,System.Boolean,System.String[])"> - <summary> - Create a <form> tag. - </summary> - <param name="name">name of form</param> - <param name="action">action to invoke on submit</param> - <param name="isAjax">form should be posted as ajax</param> - <returns>html code</returns> - <example> - <code> - // without options - WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax); - - // with options - WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax, "style", "display:inline", "class", "greenForm"); - </code> - </example> - <param name="options">html attributes or javscript options.</param> - <remarks>Method will ALWAYS be POST.</remarks> - </member> - <member name="M:HttpServer.Helpers.FormHelper.Select(System.String,System.Collections.IEnumerable,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"> - <summary> - Creates a select list with the values in a collection. - </summary> - <param name="name">Name of the SELECT-tag</param> - <param name="collection">collection used to generate options.</param> - <param name="getIdTitle">delegate used to return id and title from objects.</param> - <param name="selectedValue">value that should be marked as selected.</param> - <param name="firstEmpty">First row should contain an empty value.</param> - <returns>string containtain a SELECT-tag.</returns> - <seealso cref="T:HttpServer.Helpers.GetIdTitle"/> - </member> - <member name="M:HttpServer.Helpers.FormHelper.Select(System.String,System.String,System.Collections.IEnumerable,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"> - <summary> - Creates a select list with the values in a collection. - </summary> - <param name="name">Name of the SELECT-tag</param> - <param name="id">Id of the SELECT-tag</param> - <param name="collection">collection used to generate options.</param> - <param name="getIdTitle">delegate used to return id and title from objects.</param> - <param name="selectedValue">value that should be marked as selected.</param> - <param name="firstEmpty">First row should contain an empty value.</param> - <returns>string containtain a SELECT-tag.</returns> - <seealso cref="T:HttpServer.Helpers.GetIdTitle"/> - <example> - <code> - // Class that is going to be used in a SELECT-tag. - public class User - { - private readonly string _realName; - private readonly int _id; - public User(int id, string realName) - { - _id = id; - _realName = realName; - } - public string RealName - { - get { return _realName; } - } - - public int Id - { - get { return _id; } - } - } - - // Using an inline delegate to generate the select list - public void UserInlineDelegate() - { - List<User> items = new List<User>(); - items.Add(new User(1, "adam")); - items.Add(new User(2, "bertial")); - items.Add(new User(3, "david")); - string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value) - { - User user = (User)o; - id = user.Id; - value = user.RealName; - }, 2, true); - } - - // Using an method as delegate to generate the select list. - public void UseExternalDelegate() - { - List<User> items = new List<User>(); - items.Add(new User(1, "adam")); - items.Add(new User(2, "bertial")); - items.Add(new User(3, "david")); - string htmlSelect = Select("users", "users", items, UserOptions, 1, true); - } - - // delegate returning id and title - public static void UserOptions(object o, out object id, out object title) - { - User user = (User)o; - id = user.Id; - value = user.RealName; - } - </code> - </example> - </member> - <member name="M:HttpServer.Helpers.FormHelper.Select(System.String,System.String,System.Collections.IEnumerable,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean,System.String[])"> - <summary> - Creates a select list with the values in a collection. - </summary> - <param name="name">Name of the SELECT-tag</param> - <param name="id">Id of the SELECT-tag</param> - <param name="collection">collection used to generate options.</param> - <param name="getIdTitle">delegate used to return id and title from objects.</param> - <param name="selectedValue">value that should be marked as selected.</param> - <param name="firstEmpty">First row should contain an empty value.</param> - <param name="htmlAttributes">name, value collection of extra html attributes.</param> - <returns>string containtain a SELECT-tag.</returns> - <seealso cref="T:HttpServer.Helpers.GetIdTitle"/> - </member> - <member name="M:HttpServer.Helpers.FormHelper.Options(System.Collections.IEnumerable,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"> - <summary> - Generate a list of HTML options - </summary> - <param name="collection">collection used to generate options.</param> - <param name="getIdTitle">delegate used to return id and title from objects.</param> - <param name="selectedValue">value that should be marked as selected.</param> - <param name="firstEmpty">First row should contain an empty value.</param> - <returns></returns> - </member> - <member name="M:HttpServer.Helpers.FormHelper.CheckBox(System.String,System.Object,System.Object,System.String[])"> - <summary> - Creates a checkbox. - </summary> - <param name="name">element name</param> - <param name="value">element value</param> - <param name="isChecked">determines if the check box is selected or not. This is done diffrently depending on the - type of variable. A bool simply trigges checked or not, all other types are compared with "value" to determine if - the box is checked or not. </param> - <param name="htmlAttributes">a list with additional attributes (name, value, name, value).</param> - <returns>a generated radio button</returns> - </member> - <member name="M:HttpServer.Helpers.FormHelper.CheckBox(System.String,System.String,System.Object,System.Object,System.String[])"> - <summary> - Creates a checkbox. - </summary> - <param name="name">element name</param> - <param name="id">element id</param> - <param name="value">element value</param> - <param name="isChecked">determines if the check box is selected or not. This is done diffrently depending on the - type of variable. A bool simply trigges checked or not, all other types are compared with "value" to determine if - the box is checked or not. </param> - <param name="htmlAttributes">a list with additional attributes (name, value, name, value).</param> - <returns>a generated radio button</returns> - <remarks> - value in your business object. (check box will be selected if it matches the element value) - </remarks> - </member> - <member name="M:HttpServer.Helpers.FormHelper.CheckBox(System.String,System.String,System.Object,System.String[])"> - <summary> - Creates a checkbox. - </summary> - <param name="name">element name</param> - <param name="id">element id</param> - <param name="isChecked">determines if the check box is selected or not. This is done diffrently depending on the - type of variable. A bool simply trigges checked or not, all other types are compared with "value" to determine if - the box is checked or not. </param> - <param name="htmlAttributes">a list with additional attributes (name, value, name, value).</param> - <returns>a generated radio button</returns> - <remarks>will set value to "1".</remarks> - </member> - <member name="M:HttpServer.Helpers.FormHelper.RadioButton(System.String,System.Object,System.Object,System.String[])"> - <summary> - Creates a RadioButton. - </summary> - <param name="name">element name</param> - <param name="value">element value</param> - <param name="isSelected">determines if the radio button is selected or not. This is done diffrently depending on the - type of variable. A bool simply trigges checked or not, all other types are compared with "value" to determine if - the box is checked or not. </param> - <param name="htmlAttributes">a list with additional attributes (name, value, name, value).</param> - <returns>a generated radio button</returns> - </member> - <member name="M:HttpServer.Helpers.FormHelper.RadioButton(System.String,System.String,System.Object,System.Object,System.String[])"> - <summary> - Creates a RadioButton. - </summary> - <param name="name">element name</param> - <param name="id">element id</param> - <param name="value">element value</param> - <param name="isSelected">determines if the radio button is selected or not. This is done diffrently depending on the - type of variable. A bool simply trigges checked or not, all other types are compared with "value" to determine if - the box is checked or not. </param> - <param name="htmlAttributes">a list with additional attributes (name, value, name, value).</param> - <returns>a generated radio button</returns> - </member> - <member name="M:HttpServer.Helpers.FormHelper.End"> - <summary> - form close tag - </summary> - <returns></returns> - </member> - <member name="T:HttpServer.Exceptions.BadRequestException"> - <summary> - The request could not be understood by the server due to malformed syntax. - The client SHOULD NOT repeat the request without modifications. - - Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php - </summary> - </member> - <member name="M:HttpServer.Exceptions.BadRequestException.#ctor(System.String)"> - <summary> - Create a new bad request exception. - </summary> - <param name="errMsg">reason to why the request was bad.</param> - </member> - <member name="M:HttpServer.Exceptions.BadRequestException.#ctor(System.String,System.Exception)"> - <summary> - Create a new bad request exception. - </summary> - <param name="errMsg">reason to why the request was bad.</param> - <param name="inner">inner exception</param> - </member> - <member name="T:HttpServer.Authentication.DigestAuthentication"> - <summary> - Implements HTTP Digest authentication. It's more secure than Basic auth since password is - encrypted with a "key" from the server. - </summary> - <remarks> - Keep in mind that the password is encrypted with MD5. Use a combination of SSL and digest auth to be secure. - </remarks> - </member> - <member name="M:HttpServer.Authentication.DigestAuthentication.#ctor(HttpServer.Authentication.AuthenticationHandler,HttpServer.Authentication.AuthRequiredDelegate)"> - <summary> - Initializes a new instance of the <see cref="T:HttpServer.Authentication.DigestAuthentication"/> class. - </summary> - <param name="authenticator">Delegate used to provide information used during authentication.</param> - <param name="authRequiredDelegate">Delegate used to determine if authentication is required (may be null).</param> - </member> - <member name="M:HttpServer.Authentication.DigestAuthentication.#ctor(HttpServer.Authentication.AuthenticationHandler)"> - <summary> - Initializes a new instance of the <see cref="T:HttpServer.Authentication.DigestAuthentication"/> class. - </summary> - <param name="authenticator">Delegate used to provide information used during authentication.</param> - </member> - <member name="F:HttpServer.Authentication.DigestAuthentication.DisableNonceCheck"> - <summary> - Used by test classes to be able to use hardcoded values - </summary> - </member> - <member name="M:HttpServer.Authentication.DigestAuthentication.Authenticate(System.String,System.String,System.String,System.Object[])"> - <summary> - An authentication response have been received from the web browser. - Check if it's correct - </summary> - <param name="authenticationHeader">Contents from the Authorization header</param> - <param name="realm">Realm that should be authenticated</param> - <param name="httpVerb">GET/POST/PUT/DELETE etc.</param> - <param name="options">First option: true if username/password is correct but not cnonce</param> - <returns> - Authentication object that is stored for the request. A user class or something like that. - </returns> - <exception cref="T:System.ArgumentException">if authenticationHeader is invalid</exception> - <exception cref="T:System.ArgumentNullException">If any of the paramters is empty or null.</exception> - </member> - <member name="M:HttpServer.Authentication.DigestAuthentication.Encrypt(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String)"> - <summary> - Encrypts parameters into a Digest string - </summary> - <param name="realm">Realm that the user want's to log into.</param> - <param name="userName">User logging in</param> - <param name="password">Users password.</param> - <param name="method">HTTP metod.</param> - <param name="uri">Uri/domain that generated the login prompt.</param> - <param name="qop">The qop.</param> - <param name="nonce">The nonce.</param> - <param name="nc">The nc.</param> - <param name="cnonce">The cnonce.</param> - <returns>Digest enrypted string</returns> - </member> - <member name="M:HttpServer.Authentication.DigestAuthentication.CreateResponse(System.String,System.Object[])"> - <summary> - Create a response that can be sent in the WWW-Authenticate header. - </summary> - <param name="realm">Realm that the user should authenticate in</param> - <param name="options">First options specifies if true if username/password is correct but not cnonce.</param> - <returns>A correct auth request.</returns> - <exception cref="T:System.ArgumentNullException">If realm is empty or null.</exception> - </member> - <member name="M:HttpServer.Authentication.DigestAuthentication.Decode(System.String,System.Text.Encoding)"> - <summary> - Decodes authorization header value - </summary> - <param name="buffer">header value</param> - <param name="encoding">Encoding that the buffer is in</param> - <returns>All headers and their values if successful; otherwise null</returns> - <example> - NameValueCollection header = DigestAuthentication.Decode("response=\"6629fae49393a05397450978507c4ef1\",\r\nc=00001", Encoding.ASCII); - </example> - <remarks>Can handle lots of whitespaces and new lines without failing.</remarks> - </member> - <member name="M:HttpServer.Authentication.DigestAuthentication.GetCurrentNonce"> - <summary> - Gets the current nonce. - </summary> - <returns></returns> - </member> - <member name="M:HttpServer.Authentication.DigestAuthentication.GetMD5HashBinHex2(System.String)"> - <summary> - Gets the Md5 hash bin hex2. - </summary> - <param name="toBeHashed">To be hashed.</param> - <returns></returns> - </member> - <member name="M:HttpServer.Authentication.DigestAuthentication.IsValidNonce(System.String)"> - <summary> - determines if the nonce is valid or has expired. - </summary> - <param name="nonce">nonce value (check wikipedia for info)</param> - <returns>true if the nonce has not expired.</returns> - </member> - <member name="P:HttpServer.Authentication.DigestAuthentication.Name"> - <summary> - name used in http request. - </summary> - </member> - <member name="T:HttpServer.Sessions.MemorySessionStore"> - <summary> - Session store using memory for each session. - </summary> - </member> - <member name="M:HttpServer.Sessions.MemorySessionStore.#ctor"> - <summary> - Initializes the class setting the expirationtimer to clean the session every minute - </summary> - </member> - <member name="M:HttpServer.Sessions.MemorySessionStore.Cleanup(System.Object)"> - <summary> - Delegate for the cleanup timer - </summary> - </member> - <member name="M:HttpServer.Sessions.MemorySessionStore.Create"> - <summary> - Creates a new http session - </summary> - <returns></returns> - </member> - <member name="M:HttpServer.Sessions.MemorySessionStore.Create(System.String)"> - <summary> - Creates a new http session with a specific id - </summary> - <param name="id">Id used to identify the new cookie..</param> - <returns>A <see cref="T:HttpServer.Sessions.IHttpSession"/> object.</returns> <remarks> - Id should be generated by the store implementation if it's null or <see cref="F:System.String.Empty"/>. - </remarks> - </member> - <member name="M:HttpServer.Sessions.MemorySessionStore.Load(System.String)"> - <summary> - Load an existing session. - </summary> - <param name="sessionId"></param> - <returns></returns> - </member> - <member name="M:HttpServer.Sessions.MemorySessionStore.Save(HttpServer.Sessions.IHttpSession)"> - <summary> - Save an updated session to the store. - </summary> - <param name="session"></param> - </member> - <member name="M:HttpServer.Sessions.MemorySessionStore.AddUnused(HttpServer.Sessions.IHttpSession)"> - <summary> - We use the flyweight pattern which reuses small objects - instead of creating new each time. - </summary> - <param name="session">EmptyLanguageNode (unused) session that should be reused next time Create is called.</param> - </member> - <member name="M:HttpServer.Sessions.MemorySessionStore.Cleanup"> - <summary> - Remove expired sessions - </summary> - </member> - <member name="M:HttpServer.Sessions.MemorySessionStore.Remove(System.String)"> - <summary> - Remove a session - </summary> - <param name="sessionId">id of the session.</param> - </member> - <member name="P:HttpServer.Sessions.MemorySessionStore.Item(System.String)"> - <summary> - Load a session from the store - </summary> - <param name="sessionId"></param> - <returns>null if session is not found.</returns> - </member> - <member name="P:HttpServer.Sessions.MemorySessionStore.ExpireTime"> - <summary> - Number of minutes before a session expires. - Default is 20 minutes. - </summary> - </member> - <member name="T:HttpServer.Rendering.ITemplateInfo"> - <summary> - Keeps information about templates, so we know when to regenerate it. - </summary> + POST is designed to allow a uniform method to cover the following functions: + <list type="bullet"> + <item> + Annotation of existing resources; + </item><item> + Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; + </item><item> + Providing a block of data, such as the result of submitting a form, to a data-handling process; + </item><item> + Extending a database through an append operation. + </item> + </list> + <para> + If a resource has been created on the origin server, the response SHOULD be 201 (Created) and + contain an entity which describes the status of the request and refers to the new resource, and a + Location header (see section 14.30). + </para> + <para> + The action performed by the POST method might not result in a resource that can be identified by a URI. + In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on + whether or not the response includes an entity that describes the result. + </para><para> + Responses to this method are not cacheable, unless the response includes appropriate Cache-Control + or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent + to retrieve a cacheable resource. + </para> + </remarks> </member> - <member name="P:HttpServer.Rendering.ITemplateInfo.CompiledWhen"> + <member name="F:HttpServer.Methods.Put"> <summary> - When the template was compiled. + The PUT method requests that the enclosed entity be stored under the supplied Request-URI. </summary> - <remarks>Use this date to determine if the template is old and needs to be recompiled.</remarks> + <remarks> + <list type="bullet"> + <item> + If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a + modified version of the one residing on the origin server. + </item><item> + If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new + resource by the requesting user agent, the origin server can create the resource with that URI. + </item><item> + If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. + </item><item> + If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to + indicate successful completion of the request. + </item><item> + If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be + given that reflects the nature of the problem. + </item> + </list> + <para> + The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not + understand or implement and MUST return a 501 (Not Implemented) response in such cases. + </para> + </remarks> </member> - <member name="P:HttpServer.Rendering.ITemplateInfo.Filename"> + <member name="F:HttpServer.Methods.Trace"> <summary> - Template file name. + The TRACE method is used to invoke a remote, application-layer loop- back of the request message. </summary> </member> - <member name="P:HttpServer.Rendering.ITemplateInfo.Template"> + <member name="T:HttpServer.HttpHelper"> <summary> - The actual template. + Generic helper functions for HTTP </summary> </member> - <member name="T:HttpServer.Helpers.FormValidator"> + <member name="F:HttpServer.HttpHelper.HTTP10"> <summary> - Validator is used to validate all input items in a form. + Version string for HTTP v1.0 </summary> </member> - <member name="M:HttpServer.Helpers.FormValidator.#ctor(System.Collections.Specialized.NameValueCollection)"> + <member name="F:HttpServer.HttpHelper.HTTP11"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Helpers.FormValidator"/> class. + Version string for HTTP v1.1 </summary> - <param name="errors">collection to be filled with errors</param> </member> - <member name="M:HttpServer.Helpers.FormValidator.#ctor(System.Collections.Specialized.NameValueCollection,Fadd.Globalization.LanguageNode)"> + <member name="F:HttpServer.HttpHelper.EmptyUri"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Helpers.FormValidator"/> class. + An empty URI </summary> - <param name="errors">collection to be filled with errors</param> - <param name="modelLanguage">Translation used to translate the "name" parameters in all validation methods.</param> </member> - <member name="M:HttpServer.Helpers.FormValidator.#ctor(Fadd.Globalization.LanguageNode)"> + <member name="M:HttpServer.HttpHelper.ParseQueryString(System.String)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Helpers.FormValidator"/> class. + Parses a query string. </summary> - <param name="modelLanguage">Translation used to translate the "name" parameters in all validation methods.</param> + <param name="queryString">Query string (URI encoded)</param> + <returns>A <see cref="T:HttpServer.HttpInput"/> object if successful; otherwise <see cref="F:HttpServer.HttpInput.Empty"/></returns> + <exception cref="T:System.ArgumentNullException"><c>queryString</c> is null.</exception> + <exception cref="T:System.FormatException">If string cannot be parsed.</exception> </member> - <member name="M:HttpServer.Helpers.FormValidator.#ctor(HttpServer.IHttpInput)"> + <member name="T:HttpServer.Helpers.ObjectForm"> <summary> - + The object form class takes an object and creates form items for it. </summary> - <param name="form">form that validation should be made on.</param> </member> - <member name="M:HttpServer.Helpers.FormValidator.#ctor(HttpServer.IHttpInput,System.Collections.Specialized.NameValueCollection)"> + <member name="M:HttpServer.Helpers.ObjectForm.#ctor(System.String,System.String,System.Object,System.String)"> <summary> - + Initializes a new instance of the <see cref="T:HttpServer.Helpers.ObjectForm"/> class. </summary> - <param name="errors">collection that all validation errors are added to.</param> - <param name="form">form that validation should be made on.</param> + <param name="method"></param> + <param name="name">form name *and* id.</param> + <param name="action">action to do when form is posted.</param> + <param name="obj"></param> </member> - <member name="M:HttpServer.Helpers.FormValidator.#ctor(HttpServer.IHttpInput,System.Collections.Specialized.NameValueCollection,Fadd.Globalization.LanguageNode)"> + <member name="M:HttpServer.Helpers.ObjectForm.#ctor(System.String,System.String,System.Object)"> <summary> - + Initializes a new instance of the <see cref="T:HttpServer.Helpers.ObjectForm"/> class. </summary> - <param name="errors">collection that all validation errors are added to.</param> - <param name="form">form that validation should be made on.</param> - <param name="modelLanguage">Language category used to translate field names.</param> + <param name="name">form name *and* id.</param> + <param name="action">action to do when form is posted.</param> + <param name="obj">object to get values from</param> </member> - <member name="M:HttpServer.Helpers.FormValidator.SetForm(HttpServer.IHttpInput)"> + <member name="M:HttpServer.Helpers.ObjectForm.#ctor(System.String,System.Object)"> <summary> - Switch to a new http input. + Initializes a new instance of the <see cref="T:HttpServer.Helpers.ObjectForm"/> class. </summary> - <param name="form">form to use validation for now</param> + <param name="action">form action.</param> + <param name="obj">object to get values from.</param> </member> - <member name="M:HttpServer.Helpers.FormValidator.SetForm(HttpServer.IHttpInput,Fadd.Globalization.LanguageNode)"> + <member name="M:HttpServer.Helpers.ObjectForm.Begin"> <summary> - Switch to a new http input. + write out the FORM-tag. </summary> - <param name="form">form to use validation for now</param> - <param name="modelLanguage">language for the validation</param> + <returns>generated html code</returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.Digits(System.String,System.Boolean)"> + <member name="M:HttpServer.Helpers.ObjectForm.Begin(System.Boolean)"> <summary> - Check if a value is digits only + Writeout the form tag </summary> - <param name="name">Field name.</param> - <param name="required">true if field is required (may not be empty)</param> - <returns>string if validated, otherwise string.Empty</returns> + <param name="isAjax">form should be posted through ajax.</param> + <returns>generated html code</returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.Digits(System.String,System.Boolean,System.String)"> + <member name="M:HttpServer.Helpers.ObjectForm.Tb(System.String,System.Object[])"> <summary> - Check if a value is digits only + Generates a text box. </summary> - <param name="name">Field name.</param> - <param name="extraAllowedCharacters">extra characters that is allowed.</param> - <param name="required">true if field is required (may not be empty)</param> - <returns>string if validated, otherwise string.Empty</returns> + <param name="propertyName"></param> + <param name="options"></param> + <returns>generated html code</returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.Integer(System.String)"> + <member name="M:HttpServer.Helpers.ObjectForm.Pb(System.String,System.Object[])"> <summary> - Check whether the specified form item is an integer. + password box </summary> - <param name="name">Form parameter to validate</param> - <returns>value if parameter is an int; 0 if not.</returns> + <param name="propertyName"></param> + <param name="options"></param> + <returns>generated html code</returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.Integer(System.String,System.Boolean)"> + <member name="M:HttpServer.Helpers.ObjectForm.Hidden(System.String,System.Object[])"> <summary> - Check whether the specified form item is an integer. + Hiddens the specified property name. </summary> - <param name="name">Form parameter to validate</param> - <param name="required">Paramater is required (adds an error if it's not specified)</param> - <returns>value if parameter is an int; 0 if not.</returns> + <param name="propertyName">Name of the property.</param> + <param name="options">The options.</param> + <returns>generated html code</returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.Double(System.String,System.Boolean)"> + <member name="M:HttpServer.Helpers.ObjectForm.Label(System.String,System.String)"> <summary> - Check whether the specified value is a double. + Labels the specified property name. </summary> - <param name="name">Name of the parameter</param> - <param name="required">Paramater is required (adds an error if it's not specified)</param> - <returns>value if parameter is a double; 0 if not.</returns> + <param name="propertyName">property in object.</param> + <param name="label">caption</param> + <returns>generated html code</returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.Currency(System.String,System.Boolean)"> + <member name="M:HttpServer.Helpers.ObjectForm.Cb(System.String,System.String,System.Object[])"> <summary> - Check whether the specified value is a currency amount. + Generate a checkbox </summary> - <param name="name">Name of the parameter</param> - <param name="required">Paramater is required (adds an error if it's not specified)</param> - <returns>value if parameter is a currency amount; 0 if not.</returns> + <param name="propertyName">property in object</param> + <param name="value">checkbox value</param> + <param name="options">additional html attributes.</param> + <returns>generated html code</returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.Hex(System.String,System.Boolean)"> + <member name="M:HttpServer.Helpers.ObjectForm.Select(System.String,System.String,System.String,System.Object[])"> <summary> - Validates a string to hex + Write a html select tag </summary> - <param name="name">The name of the field to validate</param> - <param name="required">If the field must be set</param> - <returns>The value if validated otherwise string.Empty</returns> + <param name="propertyName">object property.</param> + <param name="idColumn">id column</param> + <param name="titleColumn">The title column.</param> + <param name="options">The options.</param> + <returns></returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.LettersOrDigits(System.String,System.Boolean)"> + <member name="M:HttpServer.Helpers.ObjectForm.Select(System.String,System.Collections.IEnumerable,System.String,System.String,System.Object[])"> <summary> - Validate that a string only contains letters or digits. + Selects the specified property name. </summary> - <param name="name">Name of form parameter to validate.</param> - <param name="required">Value is required.</param> - <returns>value if valid; otherwise string.EmptyLanguageNode.</returns> + <param name="propertyName">Name of the property.</param> + <param name="items">The items.</param> + <param name="idColumn">The id column.</param> + <param name="titleColumn">The title column.</param> + <param name="options">The options.</param> + <returns></returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.LettersOrDigits(System.String)"> + <member name="M:HttpServer.Helpers.ObjectForm.Submit(System.String)"> <summary> - Validate that a string only contains letters or digits. + Write a submit tag. </summary> - <param name="name">Form parameter name.</param> - <returns>vaue if found; otherwise string.Empty</returns> + <param name="value">button caption</param> + <returns>html submit tag</returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.LettersOrDigits(System.String,System.Boolean,System.String)"> + <member name="M:HttpServer.Helpers.ObjectForm.End"> <summary> - Validate that a string only contains letters, digits or the specified characters + html end form tag </summary> - <param name="name">Form parameter name.</param> - <param name="required">may not be null or empty if true.</param> - <param name="extraCharacters">any other allowed characters.</param> - <returns>value if valid; otherwise string.Empty</returns> + <returns>html</returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.Letters(System.String,System.Boolean)"> + <member name="T:HttpServer.FormDecoders.UrlDecoder"> <summary> - Validate that a string consists of only letters (including special letters) + Can handle application/x-www-form-urlencoded </summary> - <param name="name"></param> - <param name="required">If a value must be passed</param> - <returns></returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.Letters(System.String,System.Boolean,System.String)"> + <member name="M:HttpServer.FormDecoders.UrlDecoder.Decode(System.IO.Stream,System.String,System.Text.Encoding)"> <summary> - Validate that a string consists of only letters (a-z and A-Z) </summary> - <param name="name"></param> - <param name="required">If a value must be passed</param> - <param name="extraCharacters">A string of extra character to test against, dont forget language specific characters and spaces if wished for</param> - <returns></returns> + <param name="stream">Stream containing the content</param> + <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case</param> + <param name="encoding">Stream encoding</param> + <returns> + A HTTP form, or null if content could not be parsed. + </returns> + <exception cref="T:System.IO.InvalidDataException">If contents in the stream is not valid input data.</exception> </member> - <member name="M:HttpServer.Helpers.FormValidator.AlphaNumeric(System.String)"> + <member name="M:HttpServer.FormDecoders.UrlDecoder.CanParse(System.String)"> <summary> - Check whether the specified value is an integer. + Checks if the decoder can handle the mime type </summary> - <param name="name">Name of the parameter</param> - <returns>value if parameter contains valid characters; string.Empty if not.</returns> + <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case.</param> + <returns>True if the decoder can parse the specified content type</returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.AlphaNumeric(System.String,System.Boolean)"> + <member name="T:HttpServer.Exceptions.NotFoundException"> <summary> - Check whether the specified value is an integer. + The requested resource was not found in the web server. </summary> - <param name="name">Name of the parameter</param> - <param name="required">Paramater is required (adds an error if it's not specified)</param> - <returns>value if parameter contains valid characters; string.Empty if not.</returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.Password(System.String,System.Boolean)"> + <member name="M:HttpServer.Exceptions.NotFoundException.#ctor(System.String,System.Exception)"> <summary> - Validate that a string only contains letters or digits or any of the <see cref="F:Fadd.Validator.PasswordChars"/>. + Create a new exception </summary> - <param name="name">Name of form parameter to validate.</param> - <param name="required">Value is required.</param> - <returns>value if valid; otherwise string.Empty.</returns> + <param name="message">message describing the error</param> + <param name="inner">inner exception</param> </member> - <member name="M:HttpServer.Helpers.FormValidator.Password(System.String)"> + <member name="M:HttpServer.Exceptions.NotFoundException.#ctor(System.String)"> <summary> - Validate that a string only contains letters or digits or any of the <see cref="F:Fadd.Validator.PasswordChars"/>. + Create a new exception </summary> - <param name="name">Form parameter name.</param> - <returns>vaue if found; otherwise string.Empty</returns> + <param name="message">message describing the error</param> </member> - <member name="M:HttpServer.Helpers.FormValidator.Required(System.String)"> + <member name="T:HttpServer.ClientAcceptedEventArgs"> <summary> - Check's weather a parameter is null or not. + Invoked when a client have been accepted by the <see cref="T:HttpServer.HttpListener"/> </summary> - <param name="name">Parameter in form</param> - <returns>true if value is not null; otherwise false.</returns> + <remarks> + Can be used to revoke incoming connections + </remarks> </member> - <member name="M:HttpServer.Helpers.FormValidator.String(System.String,System.Boolean)"> + <member name="M:HttpServer.ClientAcceptedEventArgs.#ctor(System.Net.Sockets.Socket)"> <summary> - Validate a string value + Initializes a new instance of the <see cref="T:HttpServer.ClientAcceptedEventArgs"/> class. </summary> - <param name="name">Name of form parameter to validate.</param> - <param name="required">Value is required.</param> - <returns>value if valid; otherwise string.Empty.</returns> + <param name="socket">The socket.</param> </member> - <member name="M:HttpServer.Helpers.FormValidator.String(System.String)"> + <member name="M:HttpServer.ClientAcceptedEventArgs.Revoke"> <summary> - Validate a string parameter in the form + Client may not be handled. </summary> - <param name="name">Form parameter name.</param> - <returns>vaue if found; otherwise string.Empty</returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.Email(System.String,System.Boolean)"> + <member name="P:HttpServer.ClientAcceptedEventArgs.Socket"> <summary> - validates email address using a regexp. + Accepted socket. </summary> - <param name="name">field name</param> - <param name="required">field is required (may not be null or empty).</param> - <returns>value if validation is ok; otherwise string.Empty.</returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.Char(System.String,System.Boolean)"> + <member name="P:HttpServer.ClientAcceptedEventArgs.Revoked"> <summary> - Check whether the specified value is an character. + Client should be revoked. </summary> - <param name="name">Name of the parameter</param> - <param name="required">Paramater is required (adds an error if it's not specified)</param> - <returns>value if parameter is an int; char.MinValue if not.</returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.Char(System.String)"> + <member name="T:HttpServer.RequestQueue"> <summary> - Check whether the specified value is an character. + Used to queue incoming requests. </summary> - <param name="name">Name of the parameter</param> - <returns>value if parameter is an int; char.MinValue if not.</returns> </member> - <member name="M:HttpServer.Helpers.FormValidator.Boolean(System.String,System.Boolean)"> + <member name="M:HttpServer.RequestQueue.#ctor(HttpServer.ProcessRequestHandler)"> <summary> - Checks whether a field is true (can also be in native language). + Initializes a new instance of the <see cref="T:HttpServer.RequestQueue"/> class. </summary> - <param name="name">field name</param> - <param name="required">field is required (may not be null or empty).</param> - <returns>true if value is true; false if value is false or if validation failed.</returns> - <remarks>Check validation errors to see if error ocurred.</remarks> + <param name="handler">Called when a request should be processed.</param> </member> - <member name="M:HttpServer.Helpers.FormValidator.Boolean(System.String)"> + <member name="M:HttpServer.RequestQueue.QueueThread"> <summary> - Checks whether a field is true (can also be in native language). + Used to process queued requests. </summary> - <param name="name">field name</param> - <returns>true if value is true; false if value is false or if validation failed.</returns> - <remarks>Check validation errors to see if error ocurred.</remarks> </member> - <member name="T:HttpServer.Rendering.ResourceManager"> + <member name="P:HttpServer.RequestQueue.MaxRequestCount"> <summary> - Class to handle loading of resource files + Gets or sets maximum number of allowed simultaneous requests. </summary> </member> - <member name="F:HttpServer.Rendering.ResourceManager._loadedResources"> - <summary><![CDATA[ - Maps uri's to resources, Dictionary<uri, resource> - ]]></summary> - </member> - <member name="M:HttpServer.Rendering.ResourceManager.ParseName(System.String@,System.String@)"> + <member name="P:HttpServer.RequestQueue.MaxQueueSize"> <summary> - Parses a filename and sets it to the extensionless name in lowercase. The extension is cut out without the dot. + Gets or sets maximum number of requests queuing to be handled. </summary> - <param name="filename"></param> - <param name="extension"></param> - <usage> - string ext; - string filename = "/uSeR/teSt.haMl"; - ParseName(ref filename, out ext); - Console.WriteLine("File: " + filename); - Console.WriteLine("Ext: " + ext); - -> user/test - -> haml - </usage> </member> - <member name="M:HttpServer.Rendering.ResourceManager.AddResource(System.String,HttpServer.Rendering.ResourceInfo)"> + <member name="P:HttpServer.RequestQueue.CurrentRequestCount"> <summary> - Add a resource to a specified uri without extension, ie user/test + Specifies how many requests the HTTP server is currently processing. </summary> - <param name="uri">The uri to add the resource to</param> - <param name="info">The <see cref="T:HttpServer.Rendering.ResourceInfo"/> instance describing the resource</param> </member> - <member name="M:HttpServer.Rendering.ResourceManager.LoadResources(System.String,System.Reflection.Assembly,System.String)"> + <member name="T:HttpServer.RequestQueue.QueueItem"> <summary> - Loads resources from a namespace in the given assembly to an uri + Used two queue incoming requests to avoid + thread starvation. </summary> - <param name="toUri">The uri to map the resources to</param> - <param name="fromAssembly">The assembly in which the resources reside</param> - <param name="fromNamespace">The namespace from which to load the resources</param> - <usage> - resourceLoader.LoadResources("/user/", typeof(User).Assembly, "MyLib.Models.User.Views"); - - will make ie the resource MyLib.Models.User.Views.list.Haml accessible via /user/list.haml or /user/list/ - </usage> </member> - <member name="M:HttpServer.Rendering.ResourceManager.GetResourceStream(System.String)"> + <member name="T:HttpServer.ProcessRequestHandler"> <summary> - Retrieves a stream for the specified resource path if loaded otherwise null + Method used to process a queued request </summary> - <param name="path">Path to the resource to retrieve a stream for</param> - <returns>A stream or null if the resource couldn't be found</returns> + <param name="context">Context that the request was received from.</param> + <param name="request">Request to process.</param> </member> - <member name="M:HttpServer.Rendering.ResourceManager.GetFiles(System.String)"> + <member name="T:HttpServer.Parser.RequestLineEventArgs"> <summary> - Fetch all files from the resource that matches the specified arguments. + Used when the request line have been successfully parsed. </summary> - <param name="path">The path to the resource to extract</param> - <returns> - a list of files if found; or an empty array if no files are found. - </returns> </member> - <member name="M:HttpServer.Rendering.ResourceManager.GetFiles(System.String,System.String)"> + <member name="M:HttpServer.Parser.RequestLineEventArgs.#ctor(System.String,System.String,System.String)"> <summary> - Fetch all files from the resource that matches the specified arguments. + Initializes a new instance of the <see cref="T:HttpServer.Parser.RequestLineEventArgs"/> class. </summary> - <param name="path">Where the file should reside.</param> - <param name="filename">Files to check</param> - <returns> - a list of files if found; or an empty array if no files are found. - </returns> + <param name="httpMethod">The HTTP method.</param> + <param name="uriPath">The URI path.</param> + <param name="httpVersion">The HTTP version.</param> </member> - <member name="M:HttpServer.Rendering.ResourceManager.ContainsResource(System.String)"> + <member name="M:HttpServer.Parser.RequestLineEventArgs.#ctor"> <summary> - Returns whether or not the loader has an instance of the file requested + Initializes a new instance of the <see cref="T:HttpServer.Parser.RequestLineEventArgs"/> class. </summary> - <param name="filename">The name of the template/file</param> - <returns>True if the loader can provide the file</returns> </member> - <member name="T:HttpServer.ExceptionHandler"> + <member name="P:HttpServer.Parser.RequestLineEventArgs.HttpMethod"> <summary> - We dont want to let the server to die due to exceptions thrown in worker threads. - therefore we use this delegate to give you a change to handle uncaught exceptions. + Gets or sets http method. </summary> - <param name="source">Class that the exception was thrown in.</param> - <param name="exception">Exception</param> <remarks> - Server will throw a InternalServerException in release version if you dont - handle this delegate. + Should be one of the methods declared in <see cref="T:HttpServer.Method"/>. </remarks> </member> - <member name="T:HttpServer.Controllers.AuthValidatorAttribute"> + <member name="P:HttpServer.Parser.RequestLineEventArgs.HttpVersion"> <summary> - Method marked with this attribute determines if authentication is required. + Gets or sets the version of the HTTP protocol that the client want to use. </summary> - <seealso cref="T:HttpServer.HttpModules.ControllerModule"/> - <seealso cref="T:HttpServer.HttpServer"/> - <seealso cref="T:HttpServer.Controllers.AuthRequiredAttribute"/> - <seealso cref="T:HttpServer.HttpModules.WebSiteModule"/> - <remarks> - <para>The method should take one parameter (int level), return a bool and be protected/private.</para> - <para>You should throw UnauthorizedException if you are using HTTP authentication.</para> - </remarks> - <example> - <![CDATA[ - public enum UserLevel - { - Guest, - User, - Admin, - SuperAdmin - } - public class UserController : RequestController - { - [AuthRequired(UserLevel.User)] - public string View() - { - return "Can also be viewed by users"; - } - - [AuthValidatorAttribute] - public bool ValidateUser(int level) - { - (User)user = Session["user"]; - return user != null && user.Status >= level; - } - } - ]]> - </example> </member> - <member name="T:HttpServer.RequestCookies"> + <member name="P:HttpServer.Parser.RequestLineEventArgs.UriPath"> <summary> - This class is created as a wrapper, since there are two different cookie types in .Net (Cookie and HttpCookie). - The framework might switch class in the future and we dont want to have to replace all instances + Gets or sets requested URI path. </summary> </member> - <member name="M:HttpServer.RequestCookies.#ctor(System.String)"> + <member name="T:HttpServer.IComponentProvider"> <summary> - Let's copy all the cookies. + Inversion of control interface. </summary> - <param name="cookies">value from cookie header.</param> </member> - <member name="M:HttpServer.RequestCookies.Add(HttpServer.RequestCookie)"> + <member name="M:HttpServer.IComponentProvider.AddInstance``1(System.Object)"> <summary> - Adds a cookie in the collection. + Add a component instance </summary> - <param name="cookie">cookie to add</param> - <exception cref="T:System.ArgumentNullException">cookie is null</exception> + <typeparam name="T">Interface type</typeparam> + <param name="instance">Instance to add</param> </member> - <member name="M:HttpServer.RequestCookies.GetEnumerator"> + <member name="M:HttpServer.IComponentProvider.Get``1"> <summary> - Gets a collection enumerator on the cookie list. + Get a component. </summary> - <returns>collection enumerator</returns> + <typeparam name="T">Interface type</typeparam> + <returns>Component if registered, otherwise null.</returns> + <remarks> + Component will get created if needed. + </remarks> </member> - <member name="M:HttpServer.RequestCookies.Clear"> + <member name="M:HttpServer.IComponentProvider.Contains(System.Type)"> <summary> - Remove all cookies. + Checks if the specified component interface have been added. </summary> + <param name="interfaceType"></param> + <returns>true if found; otherwise false.</returns> </member> - <member name="M:HttpServer.RequestCookies.System#Collections#Generic#IEnumerable{HttpServer#RequestCookie}#GetEnumerator"> + <member name="M:HttpServer.IComponentProvider.Add``2"> <summary> - Returns an enumerator that iterates through the collection. + Add a component. </summary> - - <returns> - A <see cref="T:System.Collections.Generic.IEnumerator`1"></see> that can be used to iterate through the collection. - </returns> - <filterpriority>1</filterpriority> + <typeparam name="InterfaceType">Type being requested.</typeparam> + <typeparam name="InstanceType">Type being created.</typeparam> </member> - <member name="P:HttpServer.RequestCookies.Count"> + <member name="T:HttpServer.HttpResponse"> <summary> - Gets the count of cookies in the collection. + Response that is sent back to the web browser / client. </summary> + <remarks> + <para> + A response can be sent if different ways. The easiest one is + to just fill the Body stream with content, everything else + will then be taken care of by the framework. The default content-type + is text/html, you should change it if you send anything else. + </para><para> + The second and slightly more complex way is to send the response + as parts. Start with sending the header using the SendHeaders method and + then you can send the body using SendBody method, but do not forget + to set <see cref="P:HttpServer.HttpResponse.ContentType"/> and <see cref="P:HttpServer.HttpResponse.ContentLength"/> before doing so. + </para> + </remarks> + <example> + <code> + // Example using response body. + class MyModule : HttpModule + { + public override bool Process(IHttpRequest request, IHttpResponse response, IHttpSession session) + { + StreamWriter writer = new StreamWriter(response.Body); + writer.WriteLine("Hello dear World!"); + writer.Flush(); + + // return true to tell webserver that we've handled the url + return true; + } + } + </code> + </example> + todo: add two examples, using SendHeaders/SendBody and just the Body stream. </member> - <member name="P:HttpServer.RequestCookies.Item(System.String)"> + <member name="T:HttpServer.IHttpResponse"> <summary> - Gets the cookie of a given identifier (null if not existing). + Response that is sent back to the web browser / client. + + A response can be sent if different ways. The easiest one is + to just fill the Body stream with content, everything else + will then be taken care of by the framework. The default content-type + is text/html, you should change it if you send anything else. + + The second and slighty more complex way is to send the response + as parts. Start with sending the header using the SendHeaders method and + then you can send the body using SendBody method, but do not forget + to set ContentType and ContentLength before doing so. </summary> + <example> + public void MyHandler(IHttpRequest request, IHttpResponse response) + { + + } + </example> </member> - <member name="T:HttpServer.RealmHandler"> + <member name="M:HttpServer.IHttpResponse.AddHeader(System.String,System.String)"> <summary> - Delegate used to find a realm/domain. + Add another header to the document. </summary> - <param name="domain"></param> - <returns></returns> - <remarks> - Realms are used during HTTP Authentication - </remarks> - <seealso cref="T:HttpServer.Authentication.AuthModule"/> - <seealso cref="T:HttpServer.Authentication.AuthenticationHandler"/> + <param name="name">Name of the header, case sensitive, use lower cases.</param> + <param name="value">Header values can span over multiple lines as long as each line starts with a white space. New line chars should be \r\n</param> + <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> + <exception cref="T:System.ArgumentException">If value conditions have not been met.</exception> + <remarks>Adding any header will override the default ones and those specified by properties.</remarks> </member> - <member name="T:HttpServer.HttpServer"> + <member name="M:HttpServer.IHttpResponse.Send"> <summary> - A complete HTTP server, you need to add a module to it to be able to handle incoming requests. + Send headers and body to the browser. </summary> - <example> - <code> - // this small example will add two web site modules, thus handling - // two different sites. In reality you should add Controller modules or something - // two the website modules to be able to handle different requests. - HttpServer server = new HttpServer(); - server.Add(new WebSiteModule("www.gauffin.com", "Gauffin Telecom AB")); - server.Add(new WebSiteModule("www.vapadi.se", "Remote PBX")); - - // start regular http - server.Start(IPAddress.Any, 80); - - // start https - server.Start(IPAddress.Any, 443, myCertificate); - </code> - </example> - <seealso cref="T:HttpServer.HttpModules.HttpModule"/> - <seealso cref="T:HttpServer.HttpModules.ControllerModule"/> - <seealso cref="T:HttpServer.HttpModules.FileModule"/> - <seealso cref="T:HttpServer.HttpListener"/> + <exception cref="T:System.InvalidOperationException">If content have already been sent.</exception> </member> - <member name="M:HttpServer.HttpServer.#ctor"> + <member name="M:HttpServer.IHttpResponse.SendBody(System.Byte[],System.Int32,System.Int32)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. + Make sure that you have specified ContentLength and sent the headers first. </summary> + <param name="buffer"></param> + <exception cref="T:System.InvalidOperationException">If headers have not been sent.</exception> + <see cref="M:HttpServer.IHttpResponse.SendHeaders"/> + <param name="offset">offest of first byte to send</param> + <param name="count">number of bytes to send.</param> + <seealso cref="M:HttpServer.IHttpResponse.Send"/> + <seealso cref="M:HttpServer.IHttpResponse.SendHeaders"/> + <remarks>This method can be used if you want to send body contents without caching them first. This + is recommended for larger files to keep the memory usage low.</remarks> </member> - <member name="M:HttpServer.HttpServer.#ctor(HttpServer.FormDecoders.FormDecoderProvider)"> + <member name="M:HttpServer.IHttpResponse.SendBody(System.Byte[])"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. + Make sure that you have specified ContentLength and sent the headers first. </summary> - <param name="decoderProvider">Form decoders are used to convert different types of posted data to the <see cref="T:HttpServer.HttpInput"/> object types.</param> - <seealso cref="T:HttpServer.FormDecoders.IFormDecoder"/> - <seealso cref="P:HttpServer.HttpServer.FormDecoderProviders"/> + <param name="buffer"></param> + <exception cref="T:System.InvalidOperationException">If headers have not been sent.</exception> + <see cref="M:HttpServer.IHttpResponse.SendHeaders"/> + <seealso cref="M:HttpServer.IHttpResponse.Send"/> + <seealso cref="M:HttpServer.IHttpResponse.SendHeaders"/> + <remarks>This method can be used if you want to send body contents without caching them first. This + is recommended for larger files to keep the memory usage low.</remarks> </member> - <member name="M:HttpServer.HttpServer.#ctor(HttpServer.Sessions.IHttpSessionStore)"> + <member name="M:HttpServer.IHttpResponse.SendHeaders"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. + Send headers to the client. </summary> - <param name="sessionStore">A session store is used to save and retrieve sessions</param> - <seealso cref="T:HttpServer.Sessions.IHttpSessionStore"/> + <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> + <seealso cref="M:HttpServer.IHttpResponse.AddHeader(System.String,System.String)"/> + <seealso cref="M:HttpServer.IHttpResponse.Send"/> + <seealso cref="M:HttpServer.IHttpResponse.SendBody(System.Byte[])"/> </member> - <member name="M:HttpServer.HttpServer.#ctor(HttpServer.ILogWriter)"> + <member name="M:HttpServer.IHttpResponse.Redirect(System.Uri)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. + Redirect client to somewhere else using the 302 status code. </summary> - <param name="logWriter">The log writer.</param> - <seealso cref="P:HttpServer.HttpServer.LogWriter"/> + <param name="uri">Destination of the redirect</param> + <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> + <remarks>You can not do anything more with the request when a redirect have been done. This should be your last + action.</remarks> </member> - <member name="M:HttpServer.HttpServer.#ctor(HttpServer.FormDecoders.FormDecoderProvider,HttpServer.ILogWriter)"> + <member name="M:HttpServer.IHttpResponse.Redirect(System.String)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. + redirect to somewhere </summary> - <param name="decoderProvider">Form decoders are used to convert different types of posted data to the <see cref="T:HttpServer.HttpInput"/> object types.</param> - <param name="logWriter">The log writer.</param> - <seealso cref="T:HttpServer.FormDecoders.IFormDecoder"/> - <seealso cref="P:HttpServer.HttpServer.FormDecoderProviders"/> - <seealso cref="P:HttpServer.HttpServer.LogWriter"/> + <param name="url">where the redirect should go</param> + <remarks> + No body are allowed when doing redirects. + </remarks> </member> - <member name="M:HttpServer.HttpServer.#ctor(HttpServer.FormDecoders.FormDecoderProvider,HttpServer.Sessions.IHttpSessionStore,HttpServer.ILogWriter)"> + <member name="P:HttpServer.IHttpResponse.Body"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.HttpServer"/> class. + The body stream is used to cache the body contents + before sending everything to the client. It's the simplest + way to serve documents. </summary> - <param name="decoderProvider">Form decoders are used to convert different types of posted data to the <see cref="T:HttpServer.HttpInput"/> object types.</param> - <param name="sessionStore">A session store is used to save and retrieve sessions</param> - <param name="logWriter">The log writer.</param> - <seealso cref="T:HttpServer.FormDecoders.IFormDecoder"/> - <seealso cref="P:HttpServer.HttpServer.FormDecoderProviders"/> - <seealso cref="P:HttpServer.HttpServer.LogWriter"/> - <seealso cref="T:HttpServer.Sessions.IHttpSessionStore"/> </member> - <member name="M:HttpServer.HttpServer.Add(HttpServer.Rules.RedirectRule)"> + <member name="P:HttpServer.IHttpResponse.ProtocolVersion"> <summary> - Adds the specified rule. + Defines the version of the HTTP Response for applications where it's required + for this to be forced. </summary> - <param name="rule">The rule.</param> </member> - <member name="M:HttpServer.HttpServer.Add(HttpServer.HttpModules.HttpModule)"> + <member name="P:HttpServer.IHttpResponse.Chunked"> <summary> - Add a <see cref="T:HttpServer.HttpModules.HttpModule"/> to the server. + The chunked encoding modifies the body of a message in order to + transfer it as a series of chunks, each with its own size indicator, + followed by an OPTIONAL trailer containing entity-header fields. This + allows dynamically produced content to be transferred along with the + information necessary for the recipient to verify that it has + received the full message. </summary> - <param name="module">mode to add</param> </member> - <member name="M:HttpServer.HttpServer.DecodeBody(HttpServer.IHttpRequest)"> + <member name="P:HttpServer.IHttpResponse.Connection"> <summary> - Decodes the request body. + Kind of connection </summary> - <param name="request">The request.</param> </member> - <member name="M:HttpServer.HttpServer.ErrorPage(HttpServer.IHttpResponse,System.Net.HttpStatusCode,System.String)"> + <member name="P:HttpServer.IHttpResponse.Encoding"> <summary> - Generate a HTTP error page (that will be added to the response body). - response status code is also set. + Encoding to use when sending stuff to the client. </summary> - <param name="response">Response that the page will be generated in.</param> - <param name="error"><see cref="T:System.Net.HttpStatusCode"/>.</param> - <param name="body">response body contents.</param> + <remarks>Default is UTF8</remarks> </member> - <member name="M:HttpServer.HttpServer.ErrorPage(HttpServer.IHttpResponse,HttpServer.Exceptions.HttpException)"> + <member name="P:HttpServer.IHttpResponse.KeepAlive"> <summary> - Generate a HTTP error page (that will be added to the response body). - response status code is also set. + Number of seconds to keep connection alive </summary> - <param name="response">Response that the page will be generated in.</param> - <param name="err">exception.</param> + <remarks>Only used if Connection property is set to ConnectionType.KeepAlive</remarks> </member> - <member name="M:HttpServer.HttpServer.GetRealm(HttpServer.IHttpRequest)"> + <member name="P:HttpServer.IHttpResponse.Status"> <summary> - Realms are used by the <see cref="T:HttpServer.Authentication.AuthModule"/>s. + Status code that is sent to the client. </summary> - <param name="request">HTTP request</param> - <returns>domain/realm.</returns> + <remarks>Default is HttpStatusCode.Ok</remarks> </member> - <member name="M:HttpServer.HttpServer.HandleRequest(HttpServer.IHttpClientContext,HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> + <member name="P:HttpServer.IHttpResponse.Reason"> <summary> - Process an incoming request. + Information about why a specific status code was used. </summary> - <param name="context">connection to client</param> - <param name="request">request information</param> - <param name="response">response that should be filled</param> - <param name="session">session information</param> </member> - <member name="M:HttpServer.HttpServer.OnClientDisconnected(HttpServer.IHttpClientContext,System.Net.Sockets.SocketError)"> + <member name="P:HttpServer.IHttpResponse.ContentLength"> <summary> - Can be overloaded to implement stuff when a client have been connected. + Size of the body. MUST be specified before sending the header, + unless property Chunked is set to true. </summary> - <remarks> - Default implementation does nothing. - </remarks> - <param name="client">client that disconnected</param> - <param name="error">disconnect reason</param> </member> - <member name="M:HttpServer.HttpServer.ProcessAuthentication(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> + <member name="P:HttpServer.IHttpResponse.ContentType"> <summary> - Handle authentication + Kind of content in the body </summary> - <param name="request"></param> - <param name="response"></param> - <param name="session"></param> - <returns>true if request can be handled; false if not.</returns> + <remarks>Default is text/html</remarks> </member> - <member name="M:HttpServer.HttpServer.RequestAuthentication(HttpServer.Authentication.AuthModule,HttpServer.IHttpRequest,HttpServer.IHttpResponse)"> + <member name="P:HttpServer.IHttpResponse.HeadersSent"> <summary> - Will request authentication. + Headers have been sent to the client- </summary> - <remarks> - Sends respond to client, nothing else can be done with the response after this. - </remarks> - <param name="mod"></param> - <param name="request"></param> - <param name="response"></param> + <remarks>You can not send any additional headers if they have already been sent.</remarks> </member> - <member name="M:HttpServer.HttpServer.Start(System.Net.IPAddress,System.Int32)"> + <member name="P:HttpServer.IHttpResponse.Sent"> <summary> - Start the web server using regular HTTP. + The whole response have been sent. </summary> - <param name="address">IP Address to listen on, use IpAddress.Any to accept connections on all ip addresses/network cards.</param> - <param name="port">Port to listen on. 80 can be a good idea =)</param> </member> - <member name="M:HttpServer.HttpServer.Start(System.Net.IPAddress,System.Int32,System.Security.Cryptography.X509Certificates.X509Certificate)"> + <member name="P:HttpServer.IHttpResponse.Cookies"> <summary> - Accept secure connections. + Cookies that should be created/changed. </summary> - <param name="address">IP Address to listen on, use IpAddress.Any to accept connections on all ipaddresses/network cards.</param> - <param name="port">Port to listen on. 80 can be a good idea =)</param> - <param name="certificate">Certificate to use</param> </member> - <member name="M:HttpServer.HttpServer.Stop"> + <member name="M:HttpServer.HttpResponse.#ctor(HttpServer.IHttpClientContext,HttpServer.IHttpRequest)"> <summary> - shut down the server and listeners + Initializes a new instance of the <see cref="T:HttpServer.IHttpResponse"/> class. </summary> + <param name="context">Client that send the <see cref="T:HttpServer.IHttpRequest"/>.</param> + <param name="request">Contains information of what the client want to receive.</param> + <exception cref="T:System.ArgumentException"><see cref="P:HttpServer.IHttpRequest.HttpVersion"/> cannot be empty.</exception> </member> - <member name="M:HttpServer.HttpServer.WriteLog(HttpServer.LogPrio,System.String)"> + <member name="M:HttpServer.HttpResponse.#ctor(HttpServer.IHttpClientContext,System.String,HttpServer.ConnectionType)"> <summary> - write an entry to the log file + Initializes a new instance of the <see cref="T:HttpServer.IHttpResponse"/> class. </summary> - <param name="prio">importance of the message</param> - <param name="message">log message</param> + <param name="context">Client that send the <see cref="T:HttpServer.IHttpRequest"/>.</param> + <param name="httpVersion">Version of HTTP protocol that the client uses.</param> + <param name="connectionType">Type of HTTP connection used.</param> </member> - <member name="M:HttpServer.HttpServer.WriteLog(System.Object,HttpServer.LogPrio,System.String)"> + <member name="M:HttpServer.HttpResponse.AddHeader(System.String,System.String)"> <summary> - write an entry to the log file + Add another header to the document. </summary> - <param name="source">object that wrote the message</param> - <param name="prio">importance of the message</param> - <param name="message">log message</param> + <param name="name">Name of the header, case sensitive, use lower cases.</param> + <param name="value">Header values can span over multiple lines as long as each line starts with a white space. New line chars should be \r\n</param> + <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> + <exception cref="T:System.ArgumentException">If value conditions have not been met.</exception> + <remarks>Adding any header will override the default ones and those specified by properties.</remarks> </member> - <member name="P:HttpServer.HttpServer.AuthenticationModules"> + <member name="M:HttpServer.HttpResponse.Send"> <summary> - Modules used for authentication. The module that is is added first is used as - the default authentication module. + Send headers and body to the browser. </summary> - <remarks>Use the corresponding property - in the WebSiteModule if you are using multiple websites.</remarks> + <exception cref="T:System.InvalidOperationException">If content have already been sent.</exception> </member> - <member name="P:HttpServer.HttpServer.FormDecoderProviders"> + <member name="M:HttpServer.HttpResponse.SendBody(System.Byte[],System.Int32,System.Int32)"> <summary> - Form decoder providers are used to decode request body (which normally contains form data). + Make sure that you have specified <see cref="P:HttpServer.HttpResponse.ContentLength"/> and sent the headers first. </summary> + <param name="buffer"></param> + <exception cref="T:System.InvalidOperationException">If headers have not been sent.</exception> + <see cref="M:HttpServer.HttpResponse.SendHeaders"/> + <param name="offset">offset of first byte to send</param> + <param name="count">number of bytes to send.</param> + <seealso cref="M:HttpServer.HttpResponse.Send"/> + <seealso cref="M:HttpServer.HttpResponse.SendHeaders"/> + <remarks>This method can be used if you want to send body contents without caching them first. This + is recommended for larger files to keep the memory usage low.</remarks> </member> - <member name="P:HttpServer.HttpServer.ServerName"> + <member name="M:HttpServer.HttpResponse.SendBody(System.Byte[])"> <summary> - Server name sent in HTTP responses. + Make sure that you have specified <see cref="P:HttpServer.HttpResponse.ContentLength"/> and sent the headers first. </summary> - <remarks> - Do NOT include version in name, since it makes it - easier for hackers. - </remarks> + <param name="buffer"></param> + <exception cref="T:System.InvalidOperationException">If headers have not been sent.</exception> + <see cref="M:HttpServer.HttpResponse.SendHeaders"/> + <seealso cref="M:HttpServer.HttpResponse.Send"/> + <seealso cref="M:HttpServer.HttpResponse.SendHeaders"/> + <remarks>This method can be used if you want to send body contents without caching them first. This + is recommended for larger files to keep the memory usage low.</remarks> </member> - <member name="P:HttpServer.HttpServer.SessionCookieName"> + <member name="M:HttpServer.HttpResponse.SendHeaders"> <summary> - Name of cookie where session id is stored. + Send headers to the client. </summary> + <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> + <seealso cref="M:HttpServer.HttpResponse.AddHeader(System.String,System.String)"/> + <seealso cref="M:HttpServer.HttpResponse.Send"/> + <seealso cref="M:HttpServer.HttpResponse.SendBody(System.Byte[])"/> </member> - <member name="P:HttpServer.HttpServer.LogWriter"> + <member name="M:HttpServer.HttpResponse.Redirect(System.Uri)"> <summary> - Specified where logging should go. + Redirect client to somewhere else using the 302 status code. </summary> - <seealso cref="T:HttpServer.NullLogWriter"/> - <seealso cref="T:HttpServer.ConsoleLogWriter"/> - <seealso cref="P:HttpServer.HttpServer.LogWriter"/> + <param name="uri">Destination of the redirect</param> + <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> + <remarks>You can not do anything more with the request when a redirect have been done. This should be your last + action.</remarks> </member> - <member name="P:HttpServer.HttpServer.BackLog"> + <member name="M:HttpServer.HttpResponse.Redirect(System.String)"> <summary> - Number of connections that can wait to be accepted by the server. + redirect to somewhere </summary> - <remarks>Default is 10.</remarks> + <param name="url">where the redirect should go</param> + <remarks> + No body are allowed when doing redirects. + </remarks> </member> - <member name="E:HttpServer.HttpServer.RealmWanted"> + <member name="P:HttpServer.HttpResponse.Body"> <summary> - Realms are used during HTTP authentication. - Default realm is same as server name. + The body stream is used to cache the body contents + before sending everything to the client. It's the simplest + way to serve documents. </summary> </member> - <member name="E:HttpServer.HttpServer.ExceptionThrown"> + <member name="P:HttpServer.HttpResponse.Chunked"> <summary> - Let's to receive unhandled exceptions from the threads. + The chunked encoding modifies the body of a message in order to + transfer it as a series of chunks, each with its own size indicator, + followed by an OPTIONAL trailer containing entity-header fields. This + allows dynamically produced content to be transferred along with the + information necessary for the recipient to verify that it has + received the full message. </summary> - <remarks> - Exceptions will be thrown during debug mode if this event is not used, - exceptions will be printed to console and suppressed during release mode. - </remarks> </member> - <member name="T:HttpServer.Exceptions.UnauthorizedException"> + <member name="P:HttpServer.HttpResponse.ProtocolVersion"> <summary> - The request requires user authentication. The response MUST include a - WWW-Authenticate header field (section 14.47) containing a challenge - applicable to the requested resource. - - The client MAY repeat the request with a suitable Authorization header - field (section 14.8). If the request already included Authorization - credentials, then the 401 response indicates that authorization has been - refused for those credentials. If the 401 response contains the same challenge - as the prior response, and the user agent has already attempted authentication - at least once, then the user SHOULD be presented the entity that was given in the response, - since that entity might include relevant diagnostic information. - - HTTP access authentication is explained in rfc2617: - http://www.ietf.org/rfc/rfc2617.txt - - (description is taken from - http://www.submissionchamber.com/help-guides/error-codes.php#sec10.4.2) + Defines the version of the HTTP Response for applications where it's required + for this to be forced. </summary> </member> - <member name="M:HttpServer.Exceptions.UnauthorizedException.#ctor"> + <member name="P:HttpServer.HttpResponse.Connection"> <summary> - Create a new unauhtorized exception. + Kind of connection </summary> - <seealso cref="T:HttpServer.Exceptions.UnauthorizedException"/> </member> - <member name="M:HttpServer.Exceptions.UnauthorizedException.#ctor(System.String,System.Exception)"> + <member name="P:HttpServer.HttpResponse.Encoding"> <summary> - Create a new unauhtorized exception. + Encoding to use when sending stuff to the client. </summary> - <param name="message">reason to why the request was unauthorized.</param> - <param name="inner">inner exception</param> + <remarks>Default is UTF8</remarks> </member> - <member name="M:HttpServer.Exceptions.UnauthorizedException.#ctor(System.String)"> + <member name="P:HttpServer.HttpResponse.KeepAlive"> <summary> - Create a new unauhtorized exception. + Number of seconds to keep connection alive </summary> - <param name="message">reason to why the request was unauthorized.</param> + <remarks>Only used if Connection property is set to <see cref="F:HttpServer.ConnectionType.KeepAlive"/>.</remarks> </member> - <member name="T:HttpServer.Rendering.Tiny.TinyGenerator"> + <member name="P:HttpServer.HttpResponse.Status"> <summary> - Generates C# rendering object using ASP similiar tags in the HTML code. + Status code that is sent to the client. </summary> + <remarks>Default is <see cref="F:System.Net.HttpStatusCode.OK"/></remarks> </member> - <member name="M:HttpServer.Rendering.Tiny.TinyGenerator.GenerateCode(System.IO.TextWriter)"> + <member name="P:HttpServer.HttpResponse.Reason"> <summary> - Generate C# code from the template. + Information about why a specific status code was used. </summary> - <param name="writer">A textwriter that the generated code will be written to.</param> - <exception cref="T:System.InvalidOperationException">If the template have not been parsed first.</exception> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException">If template is incorrect</exception> </member> - <member name="M:HttpServer.Rendering.Tiny.TinyGenerator.Parse(System.String)"> + <member name="P:HttpServer.HttpResponse.ContentLength"> <summary> - Parse a file and convert into to our own template object code. + Size of the body. MUST be specified before sending the header, + unless property Chunked is set to true. </summary> - <param name="fullPath">Path and filename to a template</param> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException">If something is incorrect in the template.</exception> - <exception cref="T:System.IO.FileNotFoundException"></exception> - <exception cref="T:System.IO.DirectoryNotFoundException"></exception> - <exception cref="T:System.UnauthorizedAccessException"></exception> - <exception cref="T:System.IO.PathTooLongException"></exception> - <exception cref="T:System.NotSupportedException"></exception> </member> - <member name="M:HttpServer.Rendering.Tiny.TinyGenerator.Parse(System.IO.TextReader)"> + <member name="P:HttpServer.HttpResponse.ContentType"> <summary> - Parse a file and convert into to our own template object code. + Kind of content in the body </summary> - <param name="reader">A textreader containing our template</param> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException">If something is incorrect in the template.</exception> + <remarks>Default type is "text/html"</remarks> </member> - <member name="T:HttpServer.Rendering.TemplateManager"> + <member name="P:HttpServer.HttpResponse.HeadersSent"> <summary> - Purpose if this class is to take template objects and keep them in - memory. It will also take a filename and the code generator to use - if when the template have been changed on disk. + Headers have been sent to the client- </summary> + <remarks>You can not send any additional headers if they have already been sent.</remarks> </member> - <member name="M:HttpServer.Rendering.TemplateManager.#ctor(HttpServer.Rendering.ITemplateLoader[])"> + <member name="P:HttpServer.HttpResponse.Sent"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Rendering.TemplateManager"/> class. + The whole response have been sent. </summary> - <param name="loaders"> - Template loaders used to load templates from any source. - The loaders will be invoked in the order they are given, that is the first loader will always be asked to give a template - first. - </param> </member> - <member name="M:HttpServer.Rendering.TemplateManager.#ctor"> + <member name="P:HttpServer.HttpResponse.Cookies"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Rendering.TemplateManager"/> class. + Cookies that should be created/changed. </summary> - <remarks>Uses the file template loader.</remarks> </member> - <member name="M:HttpServer.Rendering.TemplateManager.Add(System.String,HttpServer.Rendering.ITemplateGenerator)"> + <member name="T:HttpServer.HttpRequest"> <summary> - Add a template generator + Contains server side HTTP request information. </summary> - <param name="fileExtension">File extension without the dot.</param> - <param name="generator">Generator to handle the extension</param> - <exception cref="T:System.InvalidOperationException">If the generator already exists.</exception> - <exception cref="T:System.ArgumentException">If file extension is incorrect</exception> - <exception cref="T:System.ArgumentNullException">If generator is not specified.</exception> - <example> - <code> - cache.Add("haml", new HamlGenerator()); - </code> - </example> </member> - <member name="M:HttpServer.Rendering.TemplateManager.AddType(System.Type)"> + <member name="F:HttpServer.HttpRequest.UriSplitters"> <summary> - This type should be included, so it may be called from the scripts (name space and assembly). + Chars used to split an URL path into multiple parts. </summary> - <param name="type"></param> </member> - <member name="M:HttpServer.Rendering.TemplateManager.CheckTemplate(HttpServer.Rendering.ITemplateInfo)"> + <member name="M:HttpServer.HttpRequest.AssignForm(HttpServer.HttpForm)"> <summary> - Checks the template. + Assign a form. </summary> - <param name="info">Template information, filename must be set.</param> - <returns>true if template exists and have been compiled.</returns> + <param name="form"></param> </member> - <member name="M:HttpServer.Rendering.TemplateManager.Compile(System.String,System.String,HttpServer.Rendering.TemplateArguments,System.String)"> + <member name="M:HttpServer.HttpRequest.Clone"> <summary> - Compiles the specified code. + Creates a new object that is a copy of the current instance. </summary> - <param name="fileName">Name of template.</param> - <param name="code">c# code generated from a template.</param> - <param name="arguments">Arguments as in name, value, name, value, name, value</param> - <param name="templateId"> - An id to specify the exact instance of a template. Made from joining the 'TemplateClass' with the hashcode of the filename - and the hashcode of the supplied arguments - </param> - <returns>Template</returns> - <exception cref="T:HttpServer.Rendering.TemplateException">If compilation fails</exception> + + <returns> + A new object that is a copy of this instance. + </returns> + <filterpriority>2</filterpriority> </member> - <member name="M:HttpServer.Rendering.TemplateManager.GenerateCode(System.String@)"> + <member name="M:HttpServer.HttpRequest.DecodeBody(HttpServer.FormDecoders.FormDecoderProvider)"> <summary> - Will generate code from the template. - Next step is to compile the code. + Decode body into a form. </summary> - <param name="path">Path and filename to template.</param> - <exception cref="T:System.ArgumentException"></exception> - <exception cref="T:System.InvalidOperationException">If no template generator exists for the specified extension.</exception> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException">If parsing/compiling fails</exception> - <see cref="M:HttpServer.Rendering.TemplateManager.Render(System.String,HttpServer.Rendering.TemplateArguments)"/> + <param name="providers">A list with form decoders.</param> + <exception cref="T:System.IO.InvalidDataException">If body contents is not valid for the chosen decoder.</exception> + <exception cref="T:System.InvalidOperationException">If body is still being transferred.</exception> </member> - <member name="M:HttpServer.Rendering.TemplateManager.GetGeneratorForWildCard(System.String@)"> + <member name="M:HttpServer.HttpRequest.SetCookies(HttpServer.RequestCookies)"> <summary> - Find a template using wildcards in filename. + Cookies </summary> - <param name="filePath">Full path (including wildcards in filename) to where we should find a template.</param> - <returns>First found generator if an extension was matched; otherwise null.</returns> - <remarks>method is not thread safe</remarks> + <param name="cookies">the cookies</param> </member> - <member name="M:HttpServer.Rendering.TemplateManager.RenderPartial(System.String,HttpServer.Rendering.TemplateArguments,HttpServer.Rendering.TemplateArguments)"> + <member name="M:HttpServer.HttpRequest.CreateResponse(HttpServer.IHttpClientContext)"> <summary> - Render a partial + Create a response object. </summary> - <param name="filename">Path and filename</param> - <param name="args">Variables used in the template. Should be specified as "name, value, name, value" where name is variable name and value is variable contents.</param> - <param name="arguments">Arguments passed from parent template</param> - <returns></returns> - <exception cref="T:System.InvalidOperationException"></exception> - <exception cref="T:HttpServer.Rendering.TemplateException"></exception> - <exception cref="T:System.ArgumentException"></exception> + <returns>A new <see cref="T:HttpServer.IHttpResponse"/>.</returns> </member> - <member name="M:HttpServer.Rendering.TemplateManager.Render(System.String,HttpServer.Rendering.TemplateArguments)"> + <member name="M:HttpServer.HttpRequest.AddHeader(System.String,System.String)"> <summary> - Generate HTML from a template. + Called during parsing of a <see cref="T:HttpServer.IHttpRequest"/>. </summary> - <param name="filename">Path and filename</param> - <param name="args">Variables used in the template. Should be specified as "name, value, name, value" where name is variable name and value is variable contents.</param> - <exception cref="T:System.InvalidOperationException"></exception> - <exception cref="T:Fadd.CompilerException"></exception> - <exception cref="T:System.ArgumentException"></exception> - <example> - <code> - string html = cache.Generate("views\\users\\view.haml", new TemplateArguments("user", dbUser, "isAdmin", dbUser.IsAdmin), null); - </code> - </example> + <param name="name">Name of the header, should not be URL encoded</param> + <param name="value">Value of the header, should not be URL encoded</param> + <exception cref="T:HttpServer.Exceptions.BadRequestException">If a header is incorrect.</exception> </member> - <member name="T:HttpServer.Rendering.TemplateManager.TemplateInfoImp"> + <member name="M:HttpServer.HttpRequest.AddToBody(System.Byte[],System.Int32,System.Int32)"> <summary> - Keeps information about templates, so we know when to regenerate it. + Add bytes to the body </summary> + <param name="bytes">buffer to read bytes from</param> + <param name="offset">where to start read</param> + <param name="length">number of bytes to read</param> + <returns>Number of bytes actually read (same as length unless we got all body bytes).</returns> + <exception cref="T:System.InvalidOperationException">If body is not writable</exception> + <exception cref="T:System.ArgumentNullException"><c>bytes</c> is null.</exception> + <exception cref="T:System.ArgumentOutOfRangeException"><c>offset</c> is out of range.</exception> </member> - <member name="T:HttpServer.Rendering.ResourceInfo"> + <member name="M:HttpServer.HttpRequest.Clear"> <summary> - Container to bind resource names to assemblies + Clear everything in the request </summary> </member> - <member name="M:HttpServer.Rendering.ResourceInfo.#ctor(System.String,System.Reflection.Assembly)"> + <member name="P:HttpServer.HttpRequest.Secure"> <summary> - Instantiates an instance of <see cref="T:HttpServer.Rendering.ResourceInfo"/> + Gets or sets a value indicating whether this <see cref="T:HttpServer.HttpRequest"/> is secure. </summary> - <param name="fullname">The full name/path of the resource</param> - <param name="assembly">The assembly the resource exists in</param> </member> - <member name="M:HttpServer.Rendering.ResourceInfo.GetStream"> + <member name="P:HttpServer.HttpRequest.UriPath"> <summary> - Retrieves a stream to the resouce + Path and query (will be merged with the host header) and put in Uri </summary> - <returns>Null if the resource couldn't be located somehow</returns> + <see cref="P:HttpServer.HttpRequest.Uri"/> </member> - <member name="P:HttpServer.Rendering.ResourceInfo.Assembly"> + <member name="P:HttpServer.HttpRequest.BodyIsComplete"> <summary> - Retrieves the assembly the resource resides in + Gets whether the body is complete. </summary> </member> - <member name="P:HttpServer.Rendering.ResourceInfo.Name"> + <member name="P:HttpServer.HttpRequest.AcceptTypes"> <summary> - Retrieves the full name/path of the assembly + Gets kind of types accepted by the client. </summary> </member> - <member name="P:HttpServer.Rendering.ResourceInfo.Extension"> + <member name="P:HttpServer.HttpRequest.Body"> <summary> - Retrieves the extension of the resource + Gets or sets body stream. </summary> </member> - <member name="T:HttpServer.Rendering.FileTemplateLoader"> + <member name="P:HttpServer.HttpRequest.Connection"> <summary> - This template loader loads all templates from a folder on the hard drive. + Gets or sets kind of connection used for the session. </summary> </member> - <member name="M:HttpServer.Rendering.FileTemplateLoader.#ctor(System.String)"> + <member name="P:HttpServer.HttpRequest.ContentLength"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Rendering.FileTemplateLoader"/> class. + Gets or sets number of bytes in the body. </summary> - <param name="pathPrefix">A prefix that is prepended to all requested files.</param> - <seealso cref="P:HttpServer.Rendering.FileTemplateLoader.PathPrefix"/> </member> - <member name="M:HttpServer.Rendering.FileTemplateLoader.#ctor"> + <member name="P:HttpServer.HttpRequest.Headers"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Rendering.FileTemplateLoader"/> class. + Gets headers sent by the client. </summary> </member> - <member name="M:HttpServer.Rendering.FileTemplateLoader.LoadTemplate(System.String)"> + <member name="P:HttpServer.HttpRequest.HttpVersion"> <summary> - Load a template into a <see cref="T:System.IO.TextReader"/> and return it. + Gets or sets version of HTTP protocol that's used. </summary> - <param name="path">Relative path (and filename) to template.</param> - <returns> - a <see cref="T:System.IO.TextReader"/> if file was found; otherwise null. - </returns> + <remarks> + Probably <see cref="F:HttpServer.HttpHelper.HTTP10"/> or <see cref="F:HttpServer.HttpHelper.HTTP11"/>. + </remarks> + <seealso cref="T:HttpServer.HttpHelper"/> </member> - <member name="M:HttpServer.Rendering.FileTemplateLoader.GetFiles(System.String,System.String)"> + <member name="P:HttpServer.HttpRequest.Method"> <summary> - Fetch all files from the resource that matches the specified arguments. + Gets or sets requested method. </summary> - <param name="path">Where the file should reside.</param> - <param name="filename">Files to check</param> - <returns> - a list of files if found; or an empty array if no files are found. - </returns> + <value></value> + <remarks> + Will always be in upper case. + </remarks> + <see cref="!:HttpServer.Method"/> </member> - <member name="M:HttpServer.Rendering.FileTemplateLoader.HasTemplate(System.String)"> + <member name="P:HttpServer.HttpRequest.QueryString"> <summary> - Returns whether or not the loader has an instance of the file requested + Gets variables sent in the query string </summary> - <param name="filename">The name of the template/file</param> - <returns>True if the loader can provide the file</returns> </member> - <member name="M:HttpServer.Rendering.FileTemplateLoader.CheckTemplate(HttpServer.Rendering.ITemplateInfo)"> + <member name="P:HttpServer.HttpRequest.Uri"> <summary> - Check's whether a template should be reloaded or not. + Gets or sets requested URI. </summary> - <param name="info">template information</param> - <returns> - true if template is OK; false if it do not exist or are old. - </returns> </member> - <member name="P:HttpServer.Rendering.FileTemplateLoader.PathPrefix"> + <member name="P:HttpServer.HttpRequest.UriParts"> <summary> - A prefix that is prepended to all requested files. + Uri absolute path splitted into parts. </summary> <example> - <code> - <![CDATA[ - // will look after template in Environment.CurrentDirectory + "views\\<ControllerName>\\templateName.*" - mgr.PathPrefix = "views\\"; - ]]> - </code> + // uri is: http://gauffin.com/code/tiny/ + Console.WriteLine(request.UriParts[0]); // result: code + Console.WriteLine(request.UriParts[1]); // result: tiny </example> - <remarks>PathPrefix may not be null, only string.Empty + <remarks> + If you're using controllers than the first part is controller name, + the second part is method name and the third part is Id property. </remarks> + <seealso cref="P:HttpServer.HttpRequest.Uri"/> </member> - <member name="T:HttpServer.Helpers.XmlHelper"> + <member name="P:HttpServer.HttpRequest.Param"> <summary> - Helpers to make XML handling easier + Gets parameter from <see cref="P:HttpServer.HttpRequest.QueryString"/> or <see cref="P:HttpServer.HttpRequest.Form"/>. </summary> </member> - <member name="M:HttpServer.Helpers.XmlHelper.Serialize(System.Object)"> + <member name="P:HttpServer.HttpRequest.Form"> <summary> - Serializes object to XML. + Gets form parameters. </summary> - <param name="value">object to serialize.</param> - <returns>xml</returns> - <remarks> - Removes namespaces and adds intendation - </remarks> </member> - <member name="T:HttpServer.IHttpResponse"> + <member name="P:HttpServer.HttpRequest.IsAjax"> <summary> - Response that is sent back to the web browser / client. - - A response can be sent if different ways. The easiest one is - to just fill the Body stream with content, everything else - will then be taken care of by the framework. The default content-type - is text/html, you should change it if you send anything else. - - The second and slighty more complex way is to send the response - as parts. Start with sending the header using the SendHeaders method and - then you can send the body using SendBody method, but do not forget - to set ContentType and ContentLength before doing so. + Gets whether the request was made by Ajax (Asynchronous JavaScript) </summary> - <example> - public void MyHandler(IHttpRequest request, IHttpResponse response) - { - - } - </example> </member> - <member name="M:HttpServer.IHttpResponse.AddHeader(System.String,System.String)"> + <member name="P:HttpServer.HttpRequest.Cookies"> <summary> - Add another header to the document. + Gets cookies that was sent with the request. </summary> - <param name="name">Name of the header, case sensitive, use lower cases.</param> - <param name="value">Header values can span over multiple lines as long as each line starts with a white space. New line chars should be \r\n</param> - <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> - <exception cref="T:System.ArgumentException">If value conditions have not been met.</exception> - <remarks>Adding any header will override the default ones and those specified by properties.</remarks> </member> - <member name="M:HttpServer.IHttpResponse.Send"> + <member name="T:HttpServer.Helpers.ResourceManager"> + <summary>Class to handle loading of resource files</summary> + </member> + <member name="M:HttpServer.Helpers.ResourceManager.#ctor"> <summary> - Send headers and body to the browser. + Initializes a new instance of the <see cref="T:HttpServer.Helpers.ResourceManager"/> class. </summary> - <exception cref="T:System.InvalidOperationException">If content have already been sent.</exception> </member> - <member name="M:HttpServer.IHttpResponse.SendBody(System.Byte[],System.Int32,System.Int32)"> + <member name="M:HttpServer.Helpers.ResourceManager.#ctor(HttpServer.ILogWriter)"> <summary> - Make sure that you have specified ContentLength and sent the headers first. + Initializes a new instance of the <see cref="T:HttpServer.Helpers.ResourceManager"/> class. </summary> - <param name="buffer"></param> - <exception cref="T:System.InvalidOperationException">If headers have not been sent.</exception> - <see cref="M:HttpServer.IHttpResponse.SendHeaders"/> - <param name="offset">offest of first byte to send</param> - <param name="count">number of bytes to send.</param> - <seealso cref="M:HttpServer.IHttpResponse.Send"/> - <seealso cref="M:HttpServer.IHttpResponse.SendHeaders"/> - <remarks>This method can be used if you want to send body contents without caching them first. This - is recommended for larger files to keep the memory usage low.</remarks> + <param name="writer">logger.</param> </member> - <member name="M:HttpServer.IHttpResponse.SendBody(System.Byte[])"> + <member name="M:HttpServer.Helpers.ResourceManager.LoadResources(System.String,System.Reflection.Assembly,System.String)"> <summary> - Make sure that you have specified ContentLength and sent the headers first. + Loads resources from a namespace in the given assembly to an URI </summary> - <param name="buffer"></param> - <exception cref="T:System.InvalidOperationException">If headers have not been sent.</exception> - <see cref="M:HttpServer.IHttpResponse.SendHeaders"/> - <seealso cref="M:HttpServer.IHttpResponse.Send"/> - <seealso cref="M:HttpServer.IHttpResponse.SendHeaders"/> - <remarks>This method can be used if you want to send body contents without caching them first. This - is recommended for larger files to keep the memory usage low.</remarks> + <param name="toUri">The URI to map the resources to</param> + <param name="fromAssembly">The assembly in which the resources reside</param> + <param name="fromNamespace">The namespace from which to load the resources</param> + <usage> + <code> + resourceLoader.LoadResources("/user/", typeof(User).Assembly, "MyLib.Models.User.Views"); + </code> + Will make the resource MyLib.Models.User.Views.list.Haml accessible via /user/list.haml or /user/list/ + </usage> + <returns>The amount of loaded files, giving you the possibility of making sure the resources needed gets loaded</returns> + <exception cref="T:System.InvalidOperationException">If a resource has already been mapped to an uri</exception> </member> - <member name="M:HttpServer.IHttpResponse.SendHeaders"> + <member name="M:HttpServer.Helpers.ResourceManager.GetResourceStream(System.String)"> <summary> - Send headers to the client. + Retrieves a stream for the specified resource path if loaded otherwise null </summary> - <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> - <seealso cref="M:HttpServer.IHttpResponse.AddHeader(System.String,System.String)"/> - <seealso cref="M:HttpServer.IHttpResponse.Send"/> - <seealso cref="M:HttpServer.IHttpResponse.SendBody(System.Byte[])"/> + <param name="path">Path to the resource to retrieve a stream for</param> + <returns>A stream or null if the resource couldn't be found</returns> </member> - <member name="M:HttpServer.IHttpResponse.Redirect(System.Uri)"> + <member name="M:HttpServer.Helpers.ResourceManager.GetFiles(System.String)"> <summary> - Redirect client to somewhere else using the 302 status code. + Fetch all files from the resource that matches the specified arguments. </summary> - <param name="uri">Destination of the redirect</param> - <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> - <remarks>You can not do anything more with the request when a redirect have been done. This should be your last - action.</remarks> + <param name="path">The path to the resource to extract</param> + <returns> + a list of files if found; or an empty array if no files are found. + </returns> + <exception cref="T:System.ArgumentException">Search path must end with an asterisk for finding arbitrary files</exception> </member> - <member name="M:HttpServer.IHttpResponse.Redirect(System.String)"> + <member name="M:HttpServer.Helpers.ResourceManager.GetFiles(System.String,System.String)"> <summary> - redirect to somewhere + Fetch all files from the resource that matches the specified arguments. </summary> - <param name="url">where the redirect should go</param> - <remarks> - No body are allowed when doing redirects. - </remarks> + <param name="path">Where the file should reside.</param> + <param name="filename">Files to check</param> + <returns> + a list of files if found; or an empty array if no files are found. + </returns> </member> - <member name="P:HttpServer.IHttpResponse.Body"> + <member name="M:HttpServer.Helpers.ResourceManager.ContainsResource(System.String)"> <summary> - The body stream is used to cache the body contents - before sending everything to the client. It's the simplest - way to serve documents. + Returns whether or not the loader has an instance of the file requested </summary> + <param name="filename">The name of the template/file</param> + <returns>True if the loader can provide the file</returns> </member> - <member name="P:HttpServer.IHttpResponse.Chunked"> + <member name="T:HttpServer.Helpers.JSHelper"> <summary> - The chunked encoding modifies the body of a message in order to - transfer it as a series of chunks, each with its own size indicator, - followed by an OPTIONAL trailer containing entity-header fields. This - allows dynamically produced content to be transferred along with the - information necessary for the recipient to verify that it has - received the full message. + Will contain helper functions for javascript. </summary> </member> - <member name="P:HttpServer.IHttpResponse.Connection"> + <member name="M:HttpServer.Helpers.JSHelper.AjaxRequest(System.String,System.String[])"> <summary> - Kind of connection + Requests a url through ajax </summary> + <param name="url">url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself.</param> + <param name="options">optional options in format "key, value, key, value", used in JS request object. All keys should end with colon.</param> + <returns>a link tag</returns> + <remarks>onclick attribute is used by this method.</remarks> + <example> + <code> + // plain text + JSHelper.AjaxRequest("'/user/show/1'"); + + // ajax request using this.href + string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>"; + </code> + </example> </member> - <member name="P:HttpServer.IHttpResponse.Encoding"> + <member name="M:HttpServer.Helpers.JSHelper.AjaxUpdater(System.String,System.String,System.String[])"> <summary> - Encoding to use when sending stuff to the client. + Ajax requests that updates an element with + the fetched content </summary> - <remarks>Default is UTF8</remarks> + <param name="url">url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself.</param> + <param name="targetId">element to update</param> + <param name="options">options in format "key, value, key, value". All keys should end with colon.</param> + <returns>A link tag.</returns> + <example> + <code> + JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true"); + </code> + </example> </member> - <member name="P:HttpServer.IHttpResponse.KeepAlive"> + <member name="M:HttpServer.Helpers.JSHelper.CreateDialog(System.String,System.String,System.String[])"> <summary> - Number of seconds to keep connection alive + Opens contents in a dialog window. </summary> - <remarks>Only used if Connection property is set to ConnectionType.KeepAlive</remarks> + <param name="url">url to contents of dialog</param> + <param name="title">link title</param> + <param name="options">name, value, name, value, all parameter names should end with colon.</param> </member> - <member name="P:HttpServer.IHttpResponse.Status"> + <member name="M:HttpServer.Helpers.JSHelper.CloseDialog"> <summary> - Status code that is sent to the client. + Close a javascript dialog window/div. </summary> - <remarks>Default is HttpStatusCode.Ok</remarks> + <returns>javascript for closing a dialog.</returns> + <see cref="M:HttpServer.Helpers.JSHelper.CreateDialog(System.String,System.String,System.String[])"/> </member> - <member name="P:HttpServer.IHttpResponse.Reason"> + <member name="T:HttpServer.FormDecoders.FormDecoderProvider"> <summary> - Information about why a specific status code was used. + This provider is used to let us implement any type of form decoding we want without + having to rewrite anything else in the server. </summary> </member> - <member name="P:HttpServer.IHttpResponse.ContentLength"> + <member name="M:HttpServer.FormDecoders.FormDecoderProvider.Decode(System.String,System.IO.Stream,System.Text.Encoding)"> <summary> - Size of the body. MUST be specified before sending the header, - unless property Chunked is set to true. + </summary> + <param name="contentType">Should contain boundary and type, as in: multipart/form-data; boundary=---------------------------230051238959</param> + <param name="stream">Stream containing form data.</param> + <param name="encoding">Encoding used when decoding the stream</param> + <returns><see cref="F:HttpServer.HttpInput.Empty"/> if no parser was found.</returns> + <exception cref="T:System.ArgumentException">If stream is null or not readable.</exception> + <exception cref="T:System.IO.InvalidDataException">If stream contents cannot be decoded properly.</exception> </member> - <member name="P:HttpServer.IHttpResponse.ContentType"> + <member name="M:HttpServer.FormDecoders.FormDecoderProvider.Add(HttpServer.FormDecoders.IFormDecoder)"> <summary> - Kind of content in the body + Add a decoder. </summary> - <remarks>Default is text/html</remarks> + <param name="decoder"></param> + <exception cref="T:System.ArgumentNullException"></exception> </member> - <member name="P:HttpServer.IHttpResponse.HeadersSent"> + <member name="P:HttpServer.FormDecoders.FormDecoderProvider.Count"> <summary> - Headers have been sent to the client- + Number of added decoders. </summary> - <remarks>You can not send any additional headers if they have already been sent.</remarks> </member> - <member name="P:HttpServer.IHttpResponse.Sent"> + <member name="P:HttpServer.FormDecoders.FormDecoderProvider.Decoders"> <summary> - The whole response have been sent. + Use with care. </summary> </member> - <member name="P:HttpServer.IHttpResponse.Cookies"> + <member name="P:HttpServer.FormDecoders.FormDecoderProvider.DefaultDecoder"> <summary> - Cookies that should be created/changed. + Decoder used for unknown content types. </summary> </member> <member name="T:HttpServer.ConnectionType"> @@ -5591,8 +3803,8 @@ </member> <member name="T:HttpServer.HttpInputItem"> <summary> - represents a http input item. Each item can have multiple sub items, a sub item - is made in a html form by using square brackets + represents a HTTP input item. Each item can have multiple sub items, a sub item + is made in a HTML form by using square brackets </summary> <example> // <input type="text" name="user[FirstName]" value="jonas" /> becomes: @@ -5603,7 +3815,7 @@ </remarks> </member> <member name="F:HttpServer.HttpInputItem.Empty"> - <summary> Representation of a non-initialized HttpInputItem </summary> + <summary> Representation of a non-initialized <see cref="T:HttpServer.HttpInputItem"/>.</summary> </member> <member name="M:HttpServer.HttpInputItem.#ctor(System.String,System.String)"> <summary> @@ -5621,14 +3833,15 @@ <summary> Add another value to this item </summary> - <param name="value"></param> + <param name="value">Value to add.</param> + <exception cref="T:System.InvalidOperationException">Cannot add stuff to <see cref="F:HttpServer.HttpInput.Empty"/>.</exception> </member> <member name="M:HttpServer.HttpInputItem.Contains(System.String)"> <summary> - checks if a subitem exists (and has a value). + checks if a sub-item exists (and has a value). </summary> <param name="name">name in lower case</param> - <returns>true if the subitem exists and has a value; otherwise false.</returns> + <returns>true if the sub-item exists and has a value; otherwise false.</returns> </member> <member name="M:HttpServer.HttpInputItem.ToString"> <summary> Returns a formatted representation of the instance with the values of all contained parameters </summary> @@ -5642,10 +3855,12 @@ </member> <member name="M:HttpServer.HttpInputItem.Add(System.String,System.String)"> <summary> - Add a sub item + Add a sub item. </summary> <param name="name">Can contain array formatting, the item is then parsed and added in multiple levels</param> - <param name="value"></param> + <param name="value">Value to add.</param> + <exception cref="T:System.ArgumentNullException">Argument is null.</exception> + <exception cref="T:System.InvalidOperationException">Cannot add stuff to <see cref="F:HttpServer.HttpInput.Empty"/>.</exception> </member> <member name="M:HttpServer.HttpInputItem.System#Collections#Generic#IEnumerable{HttpServer#HttpInputItem}#GetEnumerator"> <summary> @@ -5684,1336 +3899,1553 @@ Get a sub item </summary> <param name="name">name in lower case.</param> - <returns>HttpInputItem.Empty if no item was found.</returns> + <returns><see cref="F:HttpServer.HttpInputItem.Empty"/> if no item was found.</returns> + </member> + <member name="P:HttpServer.HttpInputItem.Name"> + <summary> + Name of item (in lower case). + </summary> + </member> + <member name="P:HttpServer.HttpInputItem.Value"> + <summary> + Returns the first value, or null if no value exist. + </summary> + </member> + <member name="P:HttpServer.HttpInputItem.LastValue"> + <summary> + Returns the last value, or null if no value exist. + </summary> + </member> + <member name="P:HttpServer.HttpInputItem.Values"> + <summary> + Returns the list with values. + </summary> + </member> + <member name="P:HttpServer.HttpInputItem.HttpServer#IHttpInput#Item(System.String)"> + <summary> + + </summary> + <param name="name">name in lower case</param> + <returns></returns> + </member> + <member name="T:HttpServer.Sessions.MemorySessionStore"> + <summary> + Session store using memory for each session. + </summary> + </member> + <member name="M:HttpServer.Sessions.MemorySessionStore.#ctor"> + <summary> + Initializes the class setting the expirationtimer to clean the session every minute + </summary> + </member> + <member name="M:HttpServer.Sessions.MemorySessionStore.Cleanup(System.Object)"> + <summary> + Delegate for the cleanup timer + </summary> + </member> + <member name="M:HttpServer.Sessions.MemorySessionStore.Create"> + <summary> + Creates a new http session + </summary> + <returns></returns> + </member> + <member name="M:HttpServer.Sessions.MemorySessionStore.Create(System.String)"> + <summary> + Creates a new http session with a specific id + </summary> + <param name="id">Id used to identify the new cookie..</param> + <returns>A <see cref="T:HttpServer.Sessions.IHttpSession"/> object.</returns> + <remarks> + Id should be generated by the store implementation if it's null or <see cref="F:System.String.Empty"/>. + </remarks> + </member> + <member name="M:HttpServer.Sessions.MemorySessionStore.Load(System.String)"> + <summary> + Load an existing session. + </summary> + <param name="sessionId"></param> + <returns></returns> + </member> + <member name="M:HttpServer.Sessions.MemorySessionStore.Save(HttpServer.Sessions.IHttpSession)"> + <summary> + Save an updated session to the store. + </summary> + <param name="session"></param> + </member> + <member name="M:HttpServer.Sessions.MemorySessionStore.AddUnused(HttpServer.Sessions.IHttpSession)"> + <summary> + We use the flyweight pattern which reuses small objects + instead of creating new each time. + </summary> + <param name="session">EmptyLanguageNode (unused) session that should be reused next time Create is called.</param> + </member> + <member name="M:HttpServer.Sessions.MemorySessionStore.Cleanup"> + <summary> + Remove expired sessions + </summary> + </member> + <member name="M:HttpServer.Sessions.MemorySessionStore.Remove(System.String)"> + <summary> + Remove a session + </summary> + <param name="sessionId">id of the session.</param> + </member> + <member name="P:HttpServer.Sessions.MemorySessionStore.Item(System.String)"> + <summary> + Load a session from the store + </summary> + <param name="sessionId"></param> + <returns>null if session is not found.</returns> </member> - <member name="P:HttpServer.HttpInputItem.Name"> + <member name="P:HttpServer.Sessions.MemorySessionStore.ExpireTime"> <summary> - Name of item (in lower case). + Number of minutes before a session expires. + Default is 20 minutes. </summary> </member> - <member name="P:HttpServer.HttpInputItem.Value"> + <member name="T:HttpServer.Rules.RedirectRule"> <summary> - Returns the first value, or null if no value exist. + redirects from one URL to another. </summary> </member> - <member name="P:HttpServer.HttpInputItem.LastValue"> + <member name="M:HttpServer.Rules.RedirectRule.#ctor(System.String,System.String)"> <summary> - Returns the last value, or null if no value exist. + Initializes a new instance of the <see cref="T:HttpServer.Rules.RedirectRule"/> class. </summary> + <param name="fromUrl">Absolute path (no server name)</param> + <param name="toUrl">Absolute path (no server name)</param> + <example> + server.Add(new RedirectRule("/", "/user/index")); + </example> </member> - <member name="P:HttpServer.HttpInputItem.Values"> + <member name="M:HttpServer.Rules.RedirectRule.#ctor(System.String,System.String,System.Boolean)"> <summary> - Returns the list with values. - todo: Return a readonly collection + Initializes a new instance of the <see cref="T:HttpServer.Rules.RedirectRule"/> class. </summary> + <param name="fromUrl">Absolute path (no server name)</param> + <param name="toUrl">Absolute path (no server name)</param> + <param name="shouldRedirect">true if request should be redirected, false if the request URI should be replaced.</param> + <example> + server.Add(new RedirectRule("/", "/user/index")); + </example> </member> - <member name="P:HttpServer.HttpInputItem.HttpServer#IHttpInput#Item(System.String)"> + <member name="M:HttpServer.Rules.RedirectRule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse)"> <summary> - + Process the incoming request. </summary> - <param name="name">name in lower case</param> - <returns></returns> + <param name="request">incoming HTTP request</param> + <param name="response">outgoing HTTP response</param> + <returns>true if response should be sent to the browser directly (no other rules or modules will be processed).</returns> + <remarks> + returning true means that no modules will get the request. Returning true is typically being done + for redirects. + </remarks> </member> - <member name="T:HttpServer.FormDecoders.UrlDecoder"> + <member name="P:HttpServer.Rules.RedirectRule.FromUrl"> <summary> - Can handle application/x-www-form-urlencoded + Gets string to match request URI with. </summary> + <remarks>Is compared to request.Uri.AbsolutePath</remarks> </member> - <member name="M:HttpServer.FormDecoders.UrlDecoder.Decode(System.IO.Stream,System.String,System.Text.Encoding)"> + <member name="P:HttpServer.Rules.RedirectRule.ToUrl"> <summary> + Gets where to redirect. </summary> - <param name="stream">Stream containing the content</param> - <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case</param> - <param name="encoding">Stream enconding</param> - <returns> - A http form, or null if content could not be parsed. - </returns> - <exception cref="T:System.IO.InvalidDataException">If contents in the stream is not valid input data.</exception> </member> - <member name="M:HttpServer.FormDecoders.UrlDecoder.CanParse(System.String)"> + <member name="P:HttpServer.Rules.RedirectRule.ShouldRedirect"> <summary> - Checks if the decoder can handle the mime type + Gets whether server should redirect client. </summary> - <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case.</param> - <returns>True if the decoder can parse the specified content type</returns> + <remarks> + <c>false</c> means that the rule will replace + the current request URI with the new one from this class. + <c>true</c> means that a redirect response is sent to the client. + </remarks> </member> - <member name="T:HttpServer.Controllers.ControllerTester"> + <member name="T:HttpServer.Parser.BodyEventArgs"> <summary> - Used to simply testing of controls. + Arguments used when more body bytes have come. </summary> </member> - <member name="F:HttpServer.Controllers.ControllerTester.HostName"> + <member name="M:HttpServer.Parser.BodyEventArgs.#ctor(System.Byte[],System.Int32,System.Int32)"> <summary> - Fake host name, default is "http://localhost" + Initializes a new instance of the <see cref="T:HttpServer.Parser.BodyEventArgs"/> class. </summary> + <param name="buffer">buffer that contains the received bytes.</param> + <param name="offset">offset in buffer where to start processing.</param> + <param name="count">number of bytes from <paramref name="offset"/> that should be parsed.</param> </member> - <member name="F:HttpServer.Controllers.ControllerTester.DefaultSession"> + <member name="M:HttpServer.Parser.BodyEventArgs.#ctor"> <summary> - Session used if null have been specified as argument to one of the class methods. + Initializes a new instance of the <see cref="T:HttpServer.Parser.BodyEventArgs"/> class. </summary> </member> - <member name="M:HttpServer.Controllers.ControllerTester.Get(HttpServer.Controllers.RequestController,System.String,HttpServer.IHttpResponse@,HttpServer.Sessions.IHttpSession)"> + <member name="P:HttpServer.Parser.BodyEventArgs.Buffer"> <summary> - Send a GET request to a controller. + Gets or sets buffer that contains the received bytes. </summary> - <param name="controller">Controller receiving the post request.</param> - <param name="uri">Uri visited.</param> - <param name="response">Response from the controller.</param> - <param name="session">Session used during the test. null = <see cref="F:HttpServer.Controllers.ControllerTester.DefaultSession"/> is used.</param> - <returns>body posted by the response object</returns> - <example> - <code> - void MyTest() - { - ControllerTester tester = new ControllerTester(); - - MyController controller = new MyController(); - IHttpResponse response; - string text = Get(controller, "/my/hello/1?hello=world", out response, null); - Assert.Equal("world|1", text); - } - </code> - </example> - </member> - <member name="M:HttpServer.Controllers.ControllerTester.Post(HttpServer.Controllers.RequestController,System.String,HttpServer.HttpForm,HttpServer.IHttpResponse@,HttpServer.Sessions.IHttpSession)"> - <summary> - Send a POST request to a controller. - </summary> - <param name="controller">Controller receiving the post request.</param> - <param name="uri">Uri visited.</param> - <param name="form">Form being processed by controller.</param> - <param name="response">Response from the controller.</param> - <param name="session">Session used during the test. null = <see cref="F:HttpServer.Controllers.ControllerTester.DefaultSession"/> is used.</param> - <returns>body posted by the response object</returns> - <example> - <code> - void MyTest() - { - // Create a controller. - MyController controller = new MyController(); - - // build up a form that is used by the controller. - HttpForm form = new HttpForm(); - form.Add("user[firstName]", "Jonas"); - - // Invoke the request - ControllerTester tester = new ControllerTester(); - IHttpResponse response; - string text = tester.Get(controller, "/user/create/", form, out response, null); - - // validate response back from controller. - Assert.Equal("User 'Jonas' has been created.", text); - } - </code> - </example> </member> - <member name="T:HttpServer.ClientAcceptedEventArgs"> + <member name="P:HttpServer.Parser.BodyEventArgs.Count"> <summary> - Invoked when a client have been accepted by the <see cref="T:HttpServer.HttpListener"/> + Gets or sets number of bytes from <see cref="P:HttpServer.Parser.BodyEventArgs.Offset"/> that should be parsed. </summary> - <remarks> - Can be used to revoke incoming connections - </remarks> </member> - <member name="M:HttpServer.ClientAcceptedEventArgs.#ctor(System.Net.Sockets.Socket)"> + <member name="P:HttpServer.Parser.BodyEventArgs.Offset"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.ClientAcceptedEventArgs"/> class. + Gets or sets offset in buffer where to start processing. </summary> - <param name="socket">The socket.</param> </member> - <member name="M:HttpServer.ClientAcceptedEventArgs.Revoke"> + <member name="T:HttpServer.HttpModules.WebSiteModule"> <summary> - Client may not be handled. + The website module let's you handle multiple websites in the same server. + It uses the "Host" header to check which site you want. </summary> + <remarks>It's recommended that you do not + add any other modules to HttpServer if you are using the website module. Instead, + add all wanted modules to each website.</remarks> </member> - <member name="P:HttpServer.ClientAcceptedEventArgs.Socket"> + <member name="M:HttpServer.HttpModules.WebSiteModule.#ctor(System.String,System.String)"> <summary> - Accepted socket. + </summary> + <param name="host">domain name that should be handled.</param> + <param name="name"></param> </member> - <member name="P:HttpServer.ClientAcceptedEventArgs.Revoked"> + <member name="M:HttpServer.HttpModules.WebSiteModule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> <summary> - Client should be revoked. + Method that process the url </summary> + <param name="request">Information sent by the browser about the request</param> + <param name="response">Information that is being sent back to the client.</param> + <param name="session">Session used to </param> </member> - <member name="T:HttpServer.ResponseCookie"> + <member name="P:HttpServer.HttpModules.WebSiteModule.SiteName"> <summary> - cookie being sent back to the browser. + Name of site. </summary> - <seealso cref="T:HttpServer.ResponseCookie"/> </member> - <member name="T:HttpServer.RequestCookie"> + <member name="T:HttpServer.Helpers.FormHelper"> <summary> - cookie sent by the client/browser + Helpers making it easier to work with forms. </summary> - <seealso cref="T:HttpServer.ResponseCookie"/> + <seealso cref="T:HttpServer.Helpers.ObjectForm"/> </member> - <member name="M:HttpServer.RequestCookie.#ctor(System.String,System.String)"> + <member name="F:HttpServer.Helpers.FormHelper.JSImplementation"> <summary> - Constructor. + Used to let the website use different JavaScript libraries. + Default is <see cref="T:HttpServer.Helpers.Implementations.PrototypeImp"/> </summary> - <param name="id">cookie identifier</param> - <param name="content">cookie content</param> - <exception cref="T:System.ArgumentNullException">id or content is null</exception> - <exception cref="T:System.ArgumentException">id is empty</exception> </member> - <member name="M:HttpServer.RequestCookie.ToString"> + <member name="M:HttpServer.Helpers.FormHelper.Start(System.String,System.String,System.Boolean,System.String[])"> <summary> - Gets the cookie HTML representation. + Create a <form> tag. </summary> - <returns>cookie string</returns> + <param name="id">name of form</param> + <param name="action">action to invoke on submit</param> + <param name="isAjax">form should be posted as Ajax</param> + <returns>HTML code</returns> + <example> + <code> + // without options + WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax); + + // with options + WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax, "style", "display:inline", "class", "greenForm"); + </code> + </example> + <param name="options">HTML attributes or JavaScript options.</param> + <remarks>Method will ALWAYS be POST.</remarks> + <exception cref="T:System.ArgumentException">options must consist of name, value, name, value</exception> </member> - <member name="P:HttpServer.RequestCookie.Name"> + <member name="M:HttpServer.Helpers.FormHelper.Select(System.String,System.Collections.IEnumerable,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"> <summary> - Gets the cookie identifier. + Creates a select list with the values in a collection. </summary> + <param name="name">Name of the SELECT-tag</param> + <param name="collection">collection used to generate options.</param> + <param name="getIdTitle">delegate used to return id and title from objects.</param> + <param name="selectedValue">value that should be marked as selected.</param> + <param name="firstEmpty">First row should contain an empty value.</param> + <returns>string containing a SELECT-tag.</returns> + <seealso cref="T:HttpServer.Helpers.GetIdTitle"/> </member> - <member name="P:HttpServer.RequestCookie.Value"> + <member name="M:HttpServer.Helpers.FormHelper.Select(System.String,System.String,System.Collections.IEnumerable,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"> <summary> - Cookie value. Set to null to remove cookie. + Creates a select list with the values in a collection. </summary> + <param name="name">Name of the SELECT-tag</param> + <param name="id">Id of the SELECT-tag</param> + <param name="collection">collection used to generate options.</param> + <param name="getIdTitle">delegate used to return id and title from objects.</param> + <param name="selectedValue">value that should be marked as selected.</param> + <param name="firstEmpty">First row should contain an empty value.</param> + <returns>string containing a SELECT-tag.</returns> + <seealso cref="T:HttpServer.Helpers.GetIdTitle"/> + <example> + <code> + // Class that is going to be used in a SELECT-tag. + public class User + { + private readonly string _realName; + private readonly int _id; + public User(int id, string realName) + { + _id = id; + _realName = realName; + } + public string RealName + { + get { return _realName; } + } + + public int Id + { + get { return _id; } + } + } + + // Using an inline delegate to generate the select list + public void UserInlineDelegate() + { + List<User> items = new List<User>(); + items.Add(new User(1, "adam")); + items.Add(new User(2, "bertial")); + items.Add(new User(3, "david")); + string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value) + { + User user = (User)o; + id = user.Id; + value = user.RealName; + }, 2, true); + } + + // Using an method as delegate to generate the select list. + public void UseExternalDelegate() + { + List<User> items = new List<User>(); + items.Add(new User(1, "adam")); + items.Add(new User(2, "bertial")); + items.Add(new User(3, "david")); + string htmlSelect = Select("users", "users", items, UserOptions, 1, true); + } + + // delegate returning id and title + public static void UserOptions(object o, out object id, out object title) + { + User user = (User)o; + id = user.Id; + value = user.RealName; + } + </code> + </example> + <exception cref="T:System.ArgumentNullException"><c>name</c>, <c>id</c>, <c>collection</c> or <c>getIdTitle</c> is null.</exception> </member> - <member name="M:HttpServer.ResponseCookie.#ctor(System.String,System.String,System.DateTime)"> + <member name="M:HttpServer.Helpers.FormHelper.Select(System.String,System.String,System.Collections.IEnumerable,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean,System.String[])"> <summary> - Constructor. + Creates a select list with the values in a collection. </summary> - <param name="id">cookie identifier</param> - <param name="content">cookie content</param> - <param name="expiresAt">cookie expiration date. Use DateTime.MinValue for session cookie.</param> - <exception cref="T:System.ArgumentNullException">id or content is null</exception> - <exception cref="T:System.ArgumentException">id is empty</exception> + <param name="name">Name of the SELECT-tag</param> + <param name="id">Id of the SELECT-tag</param> + <param name="collection">collection used to generate options.</param> + <param name="getIdTitle">delegate used to return id and title from objects.</param> + <param name="selectedValue">value that should be marked as selected.</param> + <param name="firstEmpty">First row should contain an empty value.</param> + <param name="htmlAttributes">name, value collection of extra HTML attributes.</param> + <returns>string containing a SELECT-tag.</returns> + <seealso cref="T:HttpServer.Helpers.GetIdTitle"/> + <exception cref="T:System.ArgumentNullException"><c>name</c>, <c>id</c>, <c>collection</c> or <c>getIdTitle</c> is null.</exception> + <exception cref="T:System.ArgumentException">Invalid HTML attribute list.</exception> </member> - <member name="M:HttpServer.ResponseCookie.#ctor(System.String,System.String,System.DateTime,System.String,System.String)"> + <member name="M:HttpServer.Helpers.FormHelper.Options(System.Collections.IEnumerable,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"> <summary> - Create a new cookie + Generate a list of HTML options </summary> - <param name="name">name identifying the cookie</param> - <param name="value">cookie value</param> - <param name="expires">when the cookie expires. Setting DateTime.MinValue will delete the cookie when the session is closed.</param> - <param name="path">Path to where the cookie is valid</param> - <param name="domain">Domain that the cookie is valid for.</param> + <param name="collection">collection used to generate options.</param> + <param name="getIdTitle">delegate used to return id and title from objects.</param> + <param name="selectedValue">value that should be marked as selected.</param> + <param name="firstEmpty">First row should contain an empty value.</param> + <returns></returns> + <exception cref="T:System.ArgumentNullException"><c>collection</c> or <c>getIdTitle</c> is null.</exception> </member> - <member name="M:HttpServer.ResponseCookie.#ctor(HttpServer.RequestCookie,System.DateTime)"> + <member name="M:HttpServer.Helpers.FormHelper.Options(System.Text.StringBuilder,System.Collections.IEnumerable,HttpServer.Helpers.GetIdTitle,System.Object,System.Boolean)"> + <exception cref="T:System.ArgumentNullException"><c>sb</c> is null.</exception> + </member> + <member name="M:HttpServer.Helpers.FormHelper.CheckBox(System.String,System.Object,System.Object,System.String[])"> <summary> - Create a new cookie + Creates a check box. </summary> - <param name="cookie">Name and value will be used</param> - <param name="expires">when the cookie expires.</param> + <param name="name">element name</param> + <param name="value">element value</param> + <param name="isChecked">determines if the check box is selected or not. This is done differently depending on the + type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if + the box is checked or not. </param> + <param name="htmlAttributes">a list with additional attributes (name, value, name, value).</param> + <returns>a generated radio button</returns> </member> - <member name="M:HttpServer.ResponseCookie.ToString"> + <member name="M:HttpServer.Helpers.FormHelper.CheckBox(System.String,System.String,System.Object,System.Object,System.String[])"> <summary> - Gets the cookie HTML representation. + Creates a check box. </summary> - <returns>cookie string</returns> + <param name="name">element name</param> + <param name="id">element id</param> + <param name="value">element value</param> + <param name="isChecked">determines if the check box is selected or not. This is done differently depending on the + type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if + the box is checked or not. </param> + <param name="htmlAttributes">a list with additional attributes (name, value, name, value).</param> + <returns>a generated radio button</returns> + <remarks> + value in your business object. (check box will be selected if it matches the element value) + </remarks> </member> - <member name="P:HttpServer.ResponseCookie.Expires"> + <member name="M:HttpServer.Helpers.FormHelper.CheckBox(System.String,System.String,System.Object,System.String[])"> <summary> - When the cookie expires. - DateTime.MinValue means that the cookie expires when the session do so. + Creates a check box. </summary> + <param name="name">element name</param> + <param name="id">element id</param> + <param name="isChecked">determines if the check box is selected or not. This is done differently depending on the + type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if + the box is checked or not. </param> + <param name="htmlAttributes">a list with additional attributes (name, value, name, value).</param> + <returns>a generated radio button</returns> + <remarks>will set value to "1".</remarks> </member> - <member name="P:HttpServer.ResponseCookie.Path"> + <member name="M:HttpServer.Helpers.FormHelper.RadioButton(System.String,System.Object,System.Object,System.String[])"> <summary> - Cookie is only valid under this path. + Creates a RadioButton. </summary> + <param name="name">element name</param> + <param name="value">element value</param> + <param name="isSelected">determines if the radio button is selected or not. This is done differently depending on the + type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if + the box is checked or not. </param> + <param name="htmlAttributes">a list with additional attributes (name, value, name, value).</param> + <returns>a generated radio button</returns> </member> - <member name="T:HttpServer.Rendering.ITinyTemplate"> + <member name="M:HttpServer.Helpers.FormHelper.RadioButton(System.String,System.String,System.Object,System.Object,System.String[])"> <summary> - Interface for dynamically generated templates. + Creates a RadioButton. </summary> - <seealso cref="T:HttpServer.Rendering.TemplateManager"/> + <param name="name">element name</param> + <param name="id">element id</param> + <param name="value">element value</param> + <param name="isSelected">determines if the radio button is selected or not. This is done differently depending on the + type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if + the box is checked or not. </param> + <param name="htmlAttributes">a list with additional attributes (name, value, name, value).</param> + <returns>a generated radio button</returns> </member> - <member name="M:HttpServer.Rendering.ITinyTemplate.Invoke(HttpServer.Rendering.TemplateArguments,HttpServer.Rendering.TemplateManager)"> + <member name="M:HttpServer.Helpers.FormHelper.End"> <summary> - Run the template to generate HTML code. + form close tag </summary> - <param name="args">arguments passed to the template</param> - <param name="hiddenTemplateManager">template manager (a manager is used to generate templates)</param> - <returns>HTML code.</returns> + <returns></returns> </member> - <member name="T:HttpServer.Rendering.CodeGeneratorException"> + <member name="T:HttpServer.Exceptions.ForbiddenException"> <summary> - Contains information on where in the template the error occurred, and what the error was. + The server understood the request, but is refusing to fulfill it. + Authorization will not help and the request SHOULD NOT be repeated. + If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, + it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information + available to the client, the status code 404 (Not Found) can be used instead. + + Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php </summary> </member> - <member name="M:HttpServer.Rendering.CodeGeneratorException.#ctor(System.Int32,System.String)"> + <member name="M:HttpServer.Exceptions.ForbiddenException.#ctor(System.String)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Rendering.CodeGeneratorException"/> class. + Initializes a new instance of the <see cref="T:HttpServer.Exceptions.ForbiddenException"/> class. </summary> - <param name="lineNumber">Line that the error appeared on.</param> - <param name="error">error description.</param> + <param name="errorMsg">error message</param> </member> - <member name="M:HttpServer.Rendering.CodeGeneratorException.#ctor(System.Int32,System.String,System.String)"> + <member name="T:HttpServer.ContentType"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Rendering.CodeGeneratorException"/> class. + Lists content type mime types. </summary> - <param name="lineNumber">Line that the error appeared on.</param> - <param name="error">error description.</param> - <param name="line">line contents.</param> </member> - <member name="P:HttpServer.Rendering.CodeGeneratorException.Line"> + <member name="F:HttpServer.ContentType.Text"> <summary> - Returns the actual line where the error originated + text/plain </summary> </member> - <member name="P:HttpServer.Rendering.CodeGeneratorException.LineNumber"> + <member name="F:HttpServer.ContentType.Html"> <summary> - Line number in template + text/haml </summary> </member> - <member name="T:HttpServer.Rendering.Haml.Nodes.SilentCodeNode"> - <summary> - The ’-’ character makes the text following it into “silent” code: C# code that is evaluated, but not output. - It is not recommended that you use this widely; almost all processing code and logic should be restricted to the Controller, Helpers, or partials. - - For example - <code> - - string foo = "hello" - - foo += " there" - - foo += " you!" - %p= foo - </code> - - Is compiled to - <example> - <p> - hello there you! - </p> - </example> - </summary> - </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.SilentCodeNode.CanHandle(System.String,System.Boolean)"> + <member name="F:HttpServer.ContentType.Javascript"> <summary> - determines if this node can handle the line (by checking the first word); + content type for javascript documents = application/javascript </summary> - <param name="word">Controller char (word)</param> - <returns>true if text belongs to this node type</returns> - <param name="firstNode">first node on line</param> + <remarks> + <para> + RFC 4329 states that text/javascript have been superseeded by + application/javascript. You might still want to check browser versions + since older ones do not support application/javascript. + </para> + <para>Browser support: http://krijnhoetmer.nl/stuff/javascript/mime-types/</para> + </remarks> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.SilentCodeNode.Parse(HttpServer.Rendering.Haml.NodeList,HttpServer.Rendering.Haml.Nodes.Node,HttpServer.Rendering.Haml.LineInfo,System.Int32@)"> + <member name="F:HttpServer.ContentType.Xml"> <summary> - Parse node contents add return a fresh node. + text/xml </summary> - <param name="prototypes">List containing all node types</param> - <param name="parent">Node that this is a subnode to. Can be null</param> - <param name="line">Line to parse</param> - <param name="offset">Where to start the parsing. Should be set to where the next node should start parsing.</param> - <returns>A node corresponding to the bla bla; null if parsing failed.</returns> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException"></exception> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.SilentCodeNode.ToCode(System.Boolean@,System.Boolean,System.Boolean)"> + <member name="T:HttpServer.ContentTypes"> <summary> - Convert the node to c# code + A list of content types </summary> - <param name="inString">True if we are inside the internal stringbuilder</param> - <param name="smallEnough">true if all subnodes fit on one line</param> - <param name="smallEnoughIsDefaultValue">smallEnough is a default value, recalc it</param> - <returns>c# code</returns> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.SilentCodeNode.ToHtml"> + <member name="M:HttpServer.ContentTypes.#ctor(System.String)"> <summary> - Convert node to HTML (with ASP-tags) + </summary> - <returns>HTML string</returns> + <param name="types">Semicolon separated content types.</param> </member> - <member name="T:HttpServer.Rendering.TemplateCompiler"> + <member name="M:HttpServer.ContentTypes.GetEnumerator"> <summary> - The compiler is responsible of creating a render object which can be - cached and used over and over again. + Returns an enumerator that iterates through a collection. </summary> - <seealso cref="T:HttpServer.Rendering.TemplateManager"/> - <seealso cref="T:HttpServer.Rendering.ITemplateGenerator"/> + <returns> + An <see cref="T:System.Collections.IEnumerator"/> object that can be used to iterate through the collection. + </returns> </member> - <member name="F:HttpServer.Rendering.TemplateCompiler.TemplateBase"> + <member name="M:HttpServer.ContentTypes.Contains(System.String)"> <summary> - Base c# code for a template object. + Searches for the specified type </summary> + <param name="type">Can also be a part of a type (searching for "xml" would return true for "application/xml").</param> + <returns>true if type was found.</returns> </member> - <member name="M:HttpServer.Rendering.TemplateCompiler.#ctor"> + <member name="P:HttpServer.ContentTypes.First"> <summary> - Create a new template compiler + Get this first content type. </summary> </member> - <member name="M:HttpServer.Rendering.TemplateCompiler.Add(System.Type)"> + <member name="P:HttpServer.ContentTypes.Item(System.String)"> <summary> - Adds the specified type. + Fetch a content type </summary> - <param name="type">The type.</param> + <param name="type">Part of type ("xml" would return "application/xml")</param> + <returns></returns> + <remarks>All content types are in lower case.</remarks> </member> - <member name="M:HttpServer.Rendering.TemplateCompiler.Compile(HttpServer.Rendering.TemplateArguments,System.String,System.String)"> + <member name="T:HttpServer.HttpModules.ReverseProxyModule"> <summary> - Compiles the specified args. + A reverse proxy are used to act as a bridge between local (protected/hidden) websites + and public clients. + + A typical usage is to allow web servers on non standard ports to still be available + to the public clients, or allow web servers on private ips to be available. </summary> - <param name="args">Arguments, should contain "name, value, name, value" etc.</param> - <param name="template">c# code that will be included in the generated template class</param> - <param name="templateId">Id of the template class</param> - <returns>Tiny template if successful; otherwise null.</returns> - <exception cref="T:Fadd.CompilerException">If compilation fails</exception> - <exception cref="T:System.ArgumentException">If args are incorrect</exception> </member> - <member name="T:HttpServer.HttpResponse"> + <member name="M:HttpServer.HttpModules.ReverseProxyModule.#ctor(System.String,System.String)"> <summary> - Response that is sent back to the web browser / client. - - A response can be sent if different ways. The easiest one is - to just fill the Body stream with content, everything else - will then be taken care of by the framework. The default content-type - is text/html, you should change it if you send anything else. - The second and slighty more complex way is to send the response - as parts. Start with sending the header using the SendHeaders method and - then you can send the body using SendBody method, but do not forget - to set ContentType and ContentLength before doing so. </summary> + <param name="source">Base url requested from browser</param> + <param name="destination">Base url on private web server</param> <example> - public void MyHandler(IHttpRequest request, IHttpResponse response) - { - - } + // this will return contents from http://192.168.1.128/view/jonas when client requests http://www.gauffin.com/user/view/jonas + _server.Add(new ReverseProxyModule("http://www.gauffin.com/user/", "http://192.168.1.128/"); </example> - todo: add two examples, using SendHeaders/SendBody and just the Body stream. - </member> - <member name="M:HttpServer.HttpResponse.#ctor(HttpServer.IHttpClientContext,HttpServer.IHttpRequest)"> - <summary> - Initializes a new instance of the <see cref="T:HttpServer.IHttpResponse"/> class. - </summary> - <param name="context">The context.</param> - <param name="request">The request.</param> </member> - <member name="M:HttpServer.HttpResponse.AddHeader(System.String,System.String)"> + <member name="M:HttpServer.HttpModules.ReverseProxyModule.CanHandle(System.Uri)"> <summary> - Add another header to the document. + Method that determines if an url should be handled or not by the module </summary> - <param name="name">Name of the header, case sensitive, use lower cases.</param> - <param name="value">Header values can span over multiple lines as long as each line starts with a white space. New line chars should be \r\n</param> - <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> - <exception cref="T:System.ArgumentException">If value conditions have not been met.</exception> - <remarks>Adding any header will override the default ones and those specified by properties.</remarks> + <param name="uri">Url requested by the client.</param> + <returns>true if module should handle the url.</returns> </member> - <member name="M:HttpServer.HttpResponse.Send"> + <member name="M:HttpServer.HttpModules.ReverseProxyModule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> <summary> - Send headers and body to the browser. + Method that process the url </summary> - <exception cref="T:System.InvalidOperationException">If content have already been sent.</exception> + <param name="request">Information sent by the browser about the request</param> + <param name="response">Information that is being sent back to the client.</param> + <param name="session">Session used to </param> </member> - <member name="M:HttpServer.HttpResponse.SendBody(System.Byte[],System.Int32,System.Int32)"> + <member name="T:HttpServer.HttpClientContext"> <summary> - Make sure that you have specified ContentLength and sent the headers first. + Contains a connection to a browser/client. </summary> - <param name="buffer"></param> - <exception cref="T:System.InvalidOperationException">If headers have not been sent.</exception> - <see cref="M:HttpServer.HttpResponse.SendHeaders"/> - <param name="offset">offest of first byte to send</param> - <param name="count">number of bytes to send.</param> - <seealso cref="M:HttpServer.HttpResponse.Send"/> - <seealso cref="M:HttpServer.HttpResponse.SendHeaders"/> - <remarks>This method can be used if you want to send body contents without caching them first. This - is recommended for larger files to keep the memory usage low.</remarks> + <remarks> + Remember to <see cref="M:HttpServer.HttpClientContext.Start"/> after you have hooked the <see cref="E:HttpServer.HttpClientContext.RequestReceived"/> event. + </remarks> + TODO: Maybe this class should be broken up into HttpClientChannel and HttpClientContext? </member> - <member name="M:HttpServer.HttpResponse.SendBody(System.Byte[])"> + <member name="M:HttpServer.HttpClientContext.#ctor(System.Boolean,System.Net.IPEndPoint,System.IO.Stream,HttpServer.IRequestParserFactory,System.Int32,System.Net.Sockets.Socket)"> <summary> - Make sure that you have specified ContentLength and sent the headers first. + Initializes a new instance of the <see cref="T:HttpServer.HttpClientContext"/> class. </summary> - <param name="buffer"></param> - <exception cref="T:System.InvalidOperationException">If headers have not been sent.</exception> - <see cref="M:HttpServer.HttpResponse.SendHeaders"/> - <seealso cref="M:HttpServer.HttpResponse.Send"/> - <seealso cref="M:HttpServer.HttpResponse.SendHeaders"/> - <remarks>This method can be used if you want to send body contents without caching them first. This - is recommended for larger files to keep the memory usage low.</remarks> + <param name="secured">true if the connection is secured (SSL/TLS)</param> + <param name="remoteEndPoint">client that connected.</param> + <param name="stream">Stream used for communication</param> + <param name="parserFactory">Used to create a <see cref="T:HttpServer.IHttpRequestParser"/>.</param> + <param name="bufferSize">Size of buffer to use when reading data. Must be at least 1024 bytes.</param> + <exception cref="T:System.Net.Sockets.SocketException">If <see cref="M:System.Net.Sockets.Socket.BeginReceive(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.AsyncCallback,System.Object)"/> fails</exception> + <exception cref="T:System.ArgumentException">Stream must be writable and readable.</exception> </member> - <member name="M:HttpServer.HttpResponse.SendHeaders"> + <member name="M:HttpServer.HttpClientContext.OnBodyBytesReceived(System.Object,HttpServer.Parser.BodyEventArgs)"> <summary> - Send headers to the client. + Process incoming body bytes. </summary> - <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> - <seealso cref="M:HttpServer.HttpResponse.AddHeader(System.String,System.String)"/> - <seealso cref="M:HttpServer.HttpResponse.Send"/> - <seealso cref="M:HttpServer.HttpResponse.SendBody(System.Byte[])"/> + <param name="sender"><see cref="T:HttpServer.IHttpRequestParser"/></param> + <param name="e">Bytes</param> </member> - <member name="M:HttpServer.HttpResponse.Redirect(System.Uri)"> + <member name="M:HttpServer.HttpClientContext.OnHeaderReceived(System.Object,HttpServer.Parser.HeaderEventArgs)"> <summary> - Redirect client to somewhere else using the 302 status code. + </summary> - <param name="uri">Destination of the redirect</param> - <exception cref="T:System.InvalidOperationException">If headers already been sent.</exception> - <remarks>You can not do anything more with the request when a redirect have been done. This should be your last - action.</remarks> + <param name="sender"></param> + <param name="e"></param> </member> - <member name="M:HttpServer.HttpResponse.Redirect(System.String)"> + <member name="M:HttpServer.HttpClientContext.Start"> <summary> - redirect to somewhere + Start reading content. </summary> - <param name="url">where the redirect should go</param> <remarks> - No body are allowed when doing redirects. + Make sure to call base.Start() if you override this method. </remarks> </member> - <member name="P:HttpServer.HttpResponse.Body"> - <summary> - The body stream is used to cache the body contents - before sending everything to the client. It's the simplest - way to serve documents. - </summary> - </member> - <member name="P:HttpServer.HttpResponse.Chunked"> + <member name="M:HttpServer.HttpClientContext.Cleanup"> <summary> - The chunked encoding modifies the body of a message in order to - transfer it as a series of chunks, each with its own size indicator, - followed by an OPTIONAL trailer containing entity-header fields. This - allows dynamically produced content to be transferred along with the - information necessary for the recipient to verify that it has - received the full message. + Clean up context. </summary> + <remarks> + Make sure to call base.Cleanup() if you override the method. + </remarks> </member> - <member name="P:HttpServer.HttpResponse.Connection"> + <member name="M:HttpServer.HttpClientContext.Disconnect(System.Net.Sockets.SocketError)"> <summary> - Kind of connection + Disconnect from client </summary> + <param name="error">error to report in the <see cref="E:HttpServer.HttpClientContext.Disconnected"/> event.</param> </member> - <member name="P:HttpServer.HttpResponse.Encoding"> - <summary> - Encoding to use when sending stuff to the client. - </summary> - <remarks>Default is UTF8</remarks> + <member name="M:HttpServer.HttpClientContext.OnReceive(System.IAsyncResult)"> + <exception cref="T:HttpServer.Exceptions.BadRequestException"><c>BadRequestException</c>.</exception> </member> - <member name="P:HttpServer.HttpResponse.KeepAlive"> + <member name="M:HttpServer.HttpClientContext.Respond(System.String,System.Net.HttpStatusCode,System.String,System.String,System.String)"> <summary> - Number of seconds to keep connection alive + Send a response. </summary> - <remarks>Only used if Connection property is set to ConnectionType.KeepAlive</remarks> + <param name="httpVersion">Either <see cref="F:HttpServer.HttpHelper.HTTP10"/> or <see cref="F:HttpServer.HttpHelper.HTTP11"/></param> + <param name="statusCode">HTTP status code</param> + <param name="reason">reason for the status code.</param> + <param name="body">HTML body contents, can be null or empty.</param> + <param name="contentType">A content type to return the body as, i.e. 'text/html' or 'text/plain', defaults to 'text/html' if null or empty</param> + <exception cref="T:System.ArgumentException">If <paramref name="httpVersion"/> is invalid.</exception> </member> - <member name="P:HttpServer.HttpResponse.Status"> + <member name="M:HttpServer.HttpClientContext.Respond(System.String,System.Net.HttpStatusCode,System.String)"> <summary> - Status code that is sent to the client. + Send a response. </summary> - <remarks>Default is HttpStatusCode.Ok</remarks> + <param name="httpVersion">Either <see cref="F:HttpServer.HttpHelper.HTTP10"/> or <see cref="F:HttpServer.HttpHelper.HTTP11"/></param> + <param name="statusCode">HTTP status code</param> + <param name="reason">reason for the status code.</param> </member> - <member name="P:HttpServer.HttpResponse.Reason"> + <member name="M:HttpServer.HttpClientContext.Respond(System.String)"> <summary> - Information about why a specific status code was used. + Send a response. </summary> + <exception cref="T:System.ArgumentNullException"></exception> </member> - <member name="P:HttpServer.HttpResponse.ContentLength"> + <member name="M:HttpServer.HttpClientContext.Send(System.Byte[])"> <summary> - Size of the body. MUST be specified before sending the header, - unless property Chunked is set to true. + send a whole buffer </summary> + <param name="buffer">buffer to send</param> + <exception cref="T:System.ArgumentNullException"></exception> </member> - <member name="P:HttpServer.HttpResponse.ContentType"> + <member name="M:HttpServer.HttpClientContext.Send(System.Byte[],System.Int32,System.Int32)"> <summary> - Kind of content in the body + Send data using the stream </summary> - <remarks>Default is text/html</remarks> + <param name="buffer">Contains data to send</param> + <param name="offset">Start position in buffer</param> + <param name="size">number of bytes to send</param> + <exception cref="T:System.ArgumentNullException"></exception> + <exception cref="T:System.ArgumentOutOfRangeException"></exception> </member> - <member name="P:HttpServer.HttpResponse.HeadersSent"> + <member name="E:HttpServer.HttpClientContext.Cleaned"> <summary> - Headers have been sent to the client- + This context have been cleaned, which means that it can be reused. </summary> - <remarks>You can not send any additional headers if they have already been sent.</remarks> </member> - <member name="P:HttpServer.HttpResponse.Sent"> + <member name="E:HttpServer.HttpClientContext.Started"> <summary> - The whole response have been sent. + Context have been started (a new client have connected) </summary> </member> - <member name="P:HttpServer.HttpResponse.Cookies"> + <member name="P:HttpServer.HttpClientContext.CurrentRequest"> <summary> - Cookies that should be created/changed. + Overload to specify own type. </summary> + <remarks> + Must be specified before the context is being used. + </remarks> </member> - <member name="T:HttpServer.HttpModules.ReverseProxyModule"> + <member name="P:HttpServer.HttpClientContext.Secured"> <summary> - A reverse proxy are used to act as a bridge between local (protected/hidden) websites - and public clients. - - A typical usage is to allow web servers on non standard ports to still be available - to the public clients, or allow web servers on private ips to be available. + Using SSL or other encryption method. </summary> </member> - <member name="M:HttpServer.HttpModules.ReverseProxyModule.#ctor(System.String,System.String)"> + <member name="P:HttpServer.HttpClientContext.IsSecured"> <summary> - - </summary> - <param name="source">Base url requested from browser</param> - <param name="destination">Base url on private web server</param> - <example> - // this will return contents from http://192.168.1.128/view/jonas when client requests http://www.gauffin.com/user/view/jonas - _server.Add(new ReverseProxyModule("http://www.gauffin.com/user/", "http://192.168.1.128/"); - </example> + Using SSL or other encryption method. + </summary> </member> - <member name="M:HttpServer.HttpModules.ReverseProxyModule.CanHandle(System.Uri)"> + <member name="P:HttpServer.HttpClientContext.LogWriter"> <summary> - Method that determines if an url should be handled or not by the module + Specify which logger to use. </summary> - <param name="uri">Url requested by the client.</param> - <returns>true if module should handle the url.</returns> </member> - <member name="M:HttpServer.HttpModules.ReverseProxyModule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> + <member name="P:HttpServer.HttpClientContext.Stream"> <summary> - Method that process the url + Gets or sets the network stream. </summary> - <param name="request">Information sent by the browser about the request</param> - <param name="response">Information that is being sent back to the client.</param> - <param name="session">Session used to </param> </member> - <member name="T:HttpServer.HttpForm"> - <summary>Container for posted form data</summary> + <member name="P:HttpServer.HttpClientContext.RemoteAddress"> + <summary> + Gets or sets IP address that the client connected from. + </summary> </member> - <member name="F:HttpServer.HttpForm.EmptyForm"> - <summary>Instance to help mark a non-initialized form</summary> + <member name="P:HttpServer.HttpClientContext.RemotePort"> + <summary> + Gets or sets port that the client connected from. + </summary> </member> - <member name="M:HttpServer.HttpForm.#ctor"> - <summary>Initializes a form container with the specified name</summary> + <member name="E:HttpServer.HttpClientContext.Disconnected"> + <summary> + The context have been disconnected. + </summary> + <remarks> + Event can be used to clean up a context, or to reuse it. + </remarks> </member> - <member name="M:HttpServer.HttpForm.#ctor(HttpServer.HttpInput)"> + <member name="E:HttpServer.HttpClientContext.RequestReceived"> <summary> - Makes a deep copy of the input + A request have been received in the context. </summary> - <param name="input">The input to copy</param> </member> - <member name="M:HttpServer.HttpForm.AddFile(HttpServer.HttpFile)"> + <member name="T:HttpServer.Helpers.XmlHelper"> <summary> - Adds a file to the collection of posted files + Helpers to make XML handling easier </summary> - <param name="file">The file to add</param> - <exception cref="T:System.ArgumentException">If the file is already added</exception> - <exception cref="T:System.ArgumentNullException">If file is null</exception> - <exception cref="T:System.InvalidOperationException">If the instance is HttpForm.EmptyForm which cannot be modified</exception> </member> - <member name="M:HttpServer.HttpForm.ContainsFile(System.String)"> + <member name="M:HttpServer.Helpers.XmlHelper.Serialize(System.Object)"> <summary> - Checks if the form contains a specified file + Serializes object to XML. </summary> - <param name="name">Field name of the file parameter</param> - <returns>True if the file exists</returns> - <exception cref="T:System.InvalidOperationException">If the instance is HttpForm.EmptyForm which cannot be modified</exception> + <param name="value">object to serialize.</param> + <returns>XML</returns> + <remarks> + Removes name spaces and adds indentation + </remarks> </member> - <member name="M:HttpServer.HttpForm.GetFile(System.String)"> + <member name="M:HttpServer.Helpers.XmlHelper.Deserialize``1(System.String)"> <summary> - Retrieves a file held by by the form + Create an object from a XML string </summary> - <param name="name">The identifier of the file</param> - <returns>The requested file or null if the file was not found</returns> - <exception cref="T:System.ArgumentNullException">If name is null or empty</exception> - <exception cref="T:System.InvalidOperationException">If the instance is HttpForm.EmptyForm which cannot be modified</exception> + <typeparam name="T">Type of object</typeparam> + <param name="xml">XML string</param> + <returns>object</returns> </member> - <member name="M:HttpServer.HttpForm.Clear"> - <summary>Disposes all held HttpFile's and resets values</summary> + <member name="T:HttpServer.Rules.RegexRedirectRule"> + <summary> + Class to make dynamic binding of redirects. Instead of having to specify a number of similar redirect rules + a regular expression can be used to identify redirect URLs and their targets. + </summary> + <example> + <![CDATA[ + new RegexRedirectRule("/(?<target>[a-z0-9]+)", "/users/${target}?find=true", RegexOptions.IgnoreCase) + ]]> + </example> </member> - <member name="T:HttpServer.Exceptions.InternalServerException"> + <member name="M:HttpServer.Rules.RegexRedirectRule.#ctor(System.String,System.String)"> <summary> - The server encountered an unexpected condition which prevented it from fulfilling the request. + Initializes a new instance of the <see cref="T:HttpServer.Rules.RegexRedirectRule"/> class. </summary> + <param name="fromUrlExpression">Expression to match URL</param> + <param name="toUrlExpression">Expression to generate URL</param> + <example> + <![CDATA[ + server.Add(new RegexRedirectRule("/(?<first>[a-zA-Z0-9]+)", "/user/${first}")); + Result of ie. /employee1 will then be /user/employee1 + ]]> + </example> </member> - <member name="M:HttpServer.Exceptions.InternalServerException.#ctor"> + <member name="M:HttpServer.Rules.RegexRedirectRule.#ctor(System.String,System.String,System.Text.RegularExpressions.RegexOptions)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Exceptions.InternalServerException"/> class. + Initializes a new instance of the <see cref="T:HttpServer.Rules.RegexRedirectRule"/> class. </summary> + <param name="fromUrlExpression">Expression to match URL</param> + <param name="toUrlExpression">Expression to generate URL</param> + <param name="options">Regular expression options to use, can be null</param> + <example> + <![CDATA[ + server.Add(new RegexRedirectRule("/(?<first>[a-zA-Z0-9]+)", "/user/{first}", RegexOptions.IgnoreCase)); + Result of ie. /employee1 will then be /user/employee1 + ]]> + </example> </member> - <member name="M:HttpServer.Exceptions.InternalServerException.#ctor(System.String)"> + <member name="M:HttpServer.Rules.RegexRedirectRule.#ctor(System.String,System.String,System.Text.RegularExpressions.RegexOptions,System.Boolean)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Exceptions.InternalServerException"/> class. + Initializes a new instance of the <see cref="T:HttpServer.Rules.RegexRedirectRule"/> class. </summary> - <param name="message">error message.</param> + <param name="fromUrlExpression">Expression to match URL</param> + <param name="toUrlExpression">Expression to generate URL</param> + <param name="options">Regular expression options to apply</param> + <param name="shouldRedirect"><c>true</c> if request should be redirected, <c>false</c> if the request URI should be replaced.</param> + <example> + <![CDATA[ + server.Add(new RegexRedirectRule("/(?<first>[a-zA-Z0-9]+)", "/user/${first}", RegexOptions.None)); + Result of ie. /employee1 will then be /user/employee1 + ]]> + </example> + <exception cref="T:System.ArgumentNullException">Argument is null.</exception> + <seealso cref="P:HttpServer.Rules.RedirectRule.ShouldRedirect"/> </member> - <member name="M:HttpServer.Exceptions.InternalServerException.#ctor(System.String,System.Exception)"> + <member name="M:HttpServer.Rules.RegexRedirectRule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Exceptions.InternalServerException"/> class. + Process the incoming request. </summary> - <param name="message">error message.</param> - <param name="inner">inner exception.</param> + <param name="request">incoming HTTP request</param> + <param name="response">outgoing HTTP response</param> + <returns>true if response should be sent to the browser directly (no other rules or modules will be processed).</returns> + <remarks> + returning true means that no modules will get the request. Returning true is typically being done + for redirects. + </remarks> + <exception cref="T:System.ArgumentNullException">If request or response is null</exception> </member> - <member name="T:HttpServer.Controllers.RawHandlerAttribute"> + <member name="T:HttpServer.Parser.HttpRequestParser"> <summary> - This attribute tells the controller that the method - uses SendHeader and/or SendBody to handle the request. + Parses a HTTP request directly from a stream </summary> </member> - <member name="T:HttpServer.Rendering.Haml.LineInfo"> + <member name="M:HttpServer.Parser.HttpRequestParser.#ctor(HttpServer.ILogWriter)"> <summary> - Contains line text and state information about a line in a HAML template. + Create a new request parser </summary> + <param name="logWriter">delegate receiving log entries.</param> </member> - <member name="M:HttpServer.Rendering.Haml.LineInfo.#ctor(System.Int32,System.String)"> + <member name="M:HttpServer.Parser.HttpRequestParser.AddToBody(System.Byte[],System.Int32,System.Int32)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Rendering.Haml.LineInfo"/> class. + Add a number of bytes to the body </summary> - <param name="lineNumber">The line number.</param> - <param name="unparsedData">The unparsed data (line contents).</param> + <param name="buffer">buffer containing more body bytes.</param> + <param name="offset">starting offset in buffer</param> + <param name="count">number of bytes, from offset, to read.</param> + <returns>offset to continue from.</returns> </member> - <member name="M:HttpServer.Rendering.Haml.LineInfo.CheckUnfinishedRule(HttpServer.Rendering.Haml.LineInfo)"> + <member name="M:HttpServer.Parser.HttpRequestParser.Clear"> <summary> - Will check that all rule conditions have been met. - Will also remove the rules if they are done. + Remove all state information for the request. </summary> - <param name="line"></param> - <returns></returns> </member> - <member name="M:HttpServer.Rendering.Haml.LineInfo.Append(HttpServer.Rendering.Haml.LineInfo)"> + <member name="M:HttpServer.Parser.HttpRequestParser.OnFirstLine(System.String)"> <summary> - Append another line + Parse request line </summary> - <param name="line"></param> + <param name="value"></param> + <exception cref="T:HttpServer.Exceptions.BadRequestException">If line is incorrect</exception> + <remarks>Expects the following format: "Method SP Request-URI SP HTTP-Version CRLF"</remarks> </member> - <member name="M:HttpServer.Rendering.Haml.LineInfo.SetParsedData(System.String)"> + <member name="M:HttpServer.Parser.HttpRequestParser.OnHeader(System.String,System.String)"> <summary> - Parsed line contents (without whitespaces in the beginning) + We've parsed a new header. </summary> - <param name="data">text contents</param> + <param name="name">Name in lower case</param> + <param name="value">Value, unmodified.</param> + <exception cref="T:HttpServer.Exceptions.BadRequestException">If content length cannot be parsed.</exception> </member> - <member name="M:HttpServer.Rendering.Haml.LineInfo.Set(System.Int32,System.Int32)"> + <member name="M:HttpServer.Parser.HttpRequestParser.Parse(System.Byte[],System.Int32,System.Int32)"> <summary> - Set intendation info to previously added line text. + Parse a message </summary> - <param name="whiteSpaces"></param> - <param name="intendation"></param> + <param name="buffer">bytes to parse.</param> + <param name="offset">where in buffer that parsing should start</param> + <param name="count">number of bytes to parse, starting on <paramref name="offset"/>.</param> + <returns>offset (where to start parsing next).</returns> + <exception cref="T:HttpServer.Exceptions.BadRequestException"><c>BadRequestException</c>.</exception> </member> - <member name="M:HttpServer.Rendering.Haml.LineInfo.Set(System.String,System.Int32,System.Int32)"> + <member name="P:HttpServer.Parser.HttpRequestParser.LogWriter"> <summary> - Assign line text + Gets or sets the log writer. </summary> - <param name="line"></param> - <param name="whiteSpaces"></param> - <param name="intendation"></param> </member> - <member name="M:HttpServer.Rendering.Haml.LineInfo.TrimRight(System.Int32)"> + <member name="P:HttpServer.Parser.HttpRequestParser.CurrentState"> <summary> - + Current state in parser. </summary> - <param name="count"></param> - <exception cref="T:System.InvalidOperationException">If extra lines have been added.</exception> </member> - <member name="P:HttpServer.Rendering.Haml.LineInfo.AppendNextLine"> + <member name="E:HttpServer.Parser.HttpRequestParser.RequestCompleted"> <summary> - If the next line should be appended to us (multi line) + A request have been successfully parsed. </summary> </member> - <member name="P:HttpServer.Rendering.Haml.LineInfo.Children"> + <member name="E:HttpServer.Parser.HttpRequestParser.BodyBytesReceived"> <summary> - Do NOT add yourself using the Add methods of the linkedList. - Parent property will add node. + More body bytes have been received. </summary> </member> - <member name="P:HttpServer.Rendering.Haml.LineInfo.UnparsedData"> + <member name="E:HttpServer.Parser.HttpRequestParser.RequestLineReceived"> <summary> - Untouched line text + Request line have been received. </summary> </member> - <member name="P:HttpServer.Rendering.Haml.LineInfo.HasChildren"> + <member name="E:HttpServer.Parser.HttpRequestParser.HeaderReceived"> <summary> - Has one or more children (intented more that this one) + A header have been received. </summary> </member> - <member name="P:HttpServer.Rendering.Haml.LineInfo.Intendation"> + <member name="T:HttpServer.LogPrio"> <summary> - Number of intends (two spaces = 1, one tab = 1) + Priority for log entries </summary> + <seealso cref="T:HttpServer.ILogWriter"/> </member> - <member name="P:HttpServer.Rendering.Haml.LineInfo.LineNumber"> + <member name="F:HttpServer.LogPrio.Trace"> <summary> - Line number + Very detailed logs to be able to follow the flow of the program. </summary> </member> - <member name="P:HttpServer.Rendering.Haml.LineInfo.Parent"> + <member name="F:HttpServer.LogPrio.Debug"> <summary> - Parent node (one level up in intendation) + Logs to help debug errors in the application </summary> </member> - <member name="P:HttpServer.Rendering.Haml.LineInfo.Data"> + <member name="F:HttpServer.LogPrio.Info"> <summary> - All line data generated on one line + Information to be able to keep track of state changes etc. </summary> </member> - <member name="P:HttpServer.Rendering.Haml.LineInfo.UnfinishedRule"> + <member name="F:HttpServer.LogPrio.Warning"> <summary> - IRule have not got all needed information yet, - keep appending lines to this LineInfo until rule says that it's done. + Something did not go as we expected, but it's no problem. </summary> </member> - <member name="P:HttpServer.Rendering.Haml.LineInfo.WhiteSpaces"> + <member name="F:HttpServer.LogPrio.Error"> <summary> - Number of whitespaces before actual entry beings. + Something that should not fail failed, but we can still keep + on going. </summary> </member> - <member name="P:HttpServer.Rendering.Haml.LineInfo.SelfClosed"> + <member name="F:HttpServer.LogPrio.Fatal"> <summary> - True if node is selfclosed (i.e. <br />) + Something failed, and we cannot handle it properly. </summary> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.DocTypeTag.Parse(HttpServer.Rendering.Haml.NodeList,HttpServer.Rendering.Haml.Nodes.Node,HttpServer.Rendering.Haml.LineInfo,System.Int32@)"> + <member name="T:HttpServer.ILogWriter"> <summary> - Parse node contents add return a fresh node. + Interface used to write to log files. </summary> - <param name="prototypes">List containing all node types</param> - <param name="parent">Node that this is a subnode to. Can be null</param> - <param name="line">Line to parse</param> - <param name="offset">Where to start the parsing. Should be set to where the next node should start parsing.</param> - <returns>A node corresponding to the bla bla; null if parsing failed.</returns> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException"></exception> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.DocTypeTag.CanHandle(System.String,System.Boolean)"> + <member name="M:HttpServer.ILogWriter.Write(System.Object,HttpServer.LogPrio,System.String)"> <summary> - determines if this node can handle the line (by checking the first word); + Write an entry to the log file. </summary> - <param name="word">Controller char (word)</param> - <returns>true if text belongs to this node type</returns> - <param name="firstNode">First node on line, used since some nodes cannot exist on their own on a line.</param> + <param name="source">object that is writing to the log</param> + <param name="priority">importance of the log message</param> + <param name="message">the message</param> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.DocTypeTag.ToHtml"> + <member name="T:HttpServer.ConsoleLogWriter"> <summary> - Convert node to HTML (with ASP-tags) + This class writes to the console. It colors the output depending on the logprio and includes a 3-level stacktrace (in debug mode) </summary> - <returns>HTML string</returns> - <exception cref="T:System.NotImplementedException"></exception> + <seealso cref="T:HttpServer.ILogWriter"/> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.DocTypeTag.ToCode(System.Boolean@,System.Boolean,System.Boolean)"> + <member name="F:HttpServer.ConsoleLogWriter.Instance"> <summary> - Convert the node to c# code + The actual instance of this class. </summary> - <param name="inString">True if we are inside the internal stringbuilder</param> - <param name="smallEnough">true if all subnodes fit on one line</param> - <param name="smallEnoughIsDefaultValue">smallEnough is a default value, recalc it</param> - <returns>c# code</returns> </member> - <member name="P:HttpServer.Rendering.Haml.Nodes.DocTypeTag.IsTextNode"> + <member name="M:HttpServer.ConsoleLogWriter.Write(System.Object,HttpServer.LogPrio,System.String)"> <summary> - Text nodes should be added as child. + Logwriters the specified source. </summary> + <param name="source">object that wrote the logentry.</param> + <param name="prio">Importance of the log message</param> + <param name="message">The message.</param> </member> - <member name="T:HttpServer.HttpModules.HttpModuleExceptionEventArgs"> + <member name="M:HttpServer.ConsoleLogWriter.GetColor(HttpServer.LogPrio)"> <summary> - Used to inform http server that + Get color for the specified logprio </summary> + <param name="prio">prio for the log entry</param> + <returns>A <see cref="T:System.ConsoleColor"/> for the prio</returns> </member> - <member name="M:HttpServer.HttpModules.HttpModuleExceptionEventArgs.#ctor(System.Exception)"> + <member name="T:HttpServer.NullLogWriter"> <summary> - Eventarguments used when an exception is thrown by a module + Default log writer, writes everything to null (nowhere). </summary> - <param name="e">the exception</param> + <seealso cref="T:HttpServer.ILogWriter"/> </member> - <member name="P:HttpServer.HttpModules.HttpModuleExceptionEventArgs.Exception"> + <member name="F:HttpServer.NullLogWriter.Instance"> <summary> - Exception thrown in a module + The logging instance. </summary> </member> - <member name="T:HttpServer.Controllers.ViewController"> + <member name="M:HttpServer.NullLogWriter.Write(System.Object,HttpServer.LogPrio,System.String)"> <summary> - View controllers integrates the templates, by adding - Render methods. + Writes everything to null </summary> + <param name="source">object that wrote the log entry.</param> + <param name="prio">Importance of the log message</param> + <param name="message">The message.</param> </member> - <member name="M:HttpServer.Controllers.ViewController.#ctor(HttpServer.Rendering.TemplateManager)"> + <member name="T:HttpServer.HttpParam"> <summary> - Create a new <see cref="T:HttpServer.Controllers.ViewController"/>. + Returns item either from a form or a query string (checks them in that order) </summary> </member> - <member name="M:HttpServer.Controllers.ViewController.#ctor(HttpServer.Controllers.ViewController)"> + <member name="F:HttpServer.HttpParam.Empty"> + <summary> Representation of a non-initialized HttpParam </summary> + </member> + <member name="M:HttpServer.HttpParam.#ctor(HttpServer.IHttpInput,HttpServer.IHttpInput)"> + <summary>Initialises the class to hold a value either from a post request or a querystring request</summary> + </member> + <member name="M:HttpServer.HttpParam.Add(System.String,System.String)"> <summary> - Create a new <see cref="T:HttpServer.Controllers.ViewController"/>. + The add method is not availible for HttpParam + since HttpParam checks both Request.Form and Request.QueryString </summary> - <param name="controller">prototype to copy information from.</param> + <param name="name">name identifying the value</param> + <param name="value">value to add</param> + <exception cref="T:System.NotImplementedException"></exception> </member> - <member name="M:HttpServer.Controllers.ViewController.Render(System.Object[])"> + <member name="M:HttpServer.HttpParam.Contains(System.String)"> <summary> - Render template for the currently invoked method. + Checks whether the form or querystring has the specified value </summary> - <param name="args">arguments/parameters used in template</param> - <returns>template generated content</returns> - <remarks>calls RenderActionWithErrors</remarks> + <param name="name">Name, case sensitive</param> + <returns>true if found; otherwise false.</returns> </member> - <member name="M:HttpServer.Controllers.ViewController.RenderAction(System.String,System.Object[])"> + <member name="M:HttpServer.HttpParam.System#Collections#Generic#IEnumerable{HttpServer#HttpInputItem}#GetEnumerator"> <summary> - Render contents into a template. + Returns an enumerator that iterates through the collection. </summary> - <param name="method">method/template to generate</param> - <param name="args">arguments/parameters used in template</param> - <returns>template generated content</returns> - <remarks>calls RenderActionWithErrors.</remarks> + + <returns> + A <see cref="T:System.Collections.Generic.IEnumerator`1"></see> that can be used to iterate through the collection. + </returns> + <filterpriority>1</filterpriority> </member> - <member name="M:HttpServer.Controllers.ViewController.MergeArguments(System.Object[])"> + <member name="M:HttpServer.HttpParam.GetEnumerator"> <summary> - Merge arguments array and Arguments property. + Returns an enumerator that iterates through a collection. </summary> - <param name="args">Arguments array to merge</param> - <returns>arguments/parameters that can be used in the template.</returns> - <remarks>Will add Request/Response/Session arguments</remarks> + + <returns> + An <see cref="T:System.Collections.IEnumerator"></see> object that can be used to iterate through the collection. + </returns> + <filterpriority>2</filterpriority> </member> - <member name="M:HttpServer.Controllers.ViewController.RenderErrors(System.String,System.Object[])"> + <member name="P:HttpServer.HttpParam.Item(System.String)"> <summary> - Renders errors from the <see cref="P:HttpServer.Controllers.ViewController.Errors"/> property into the - current method template, or as a JavaScript alert if the request is Ajax. + Fetch an item from the form or querystring (in that order). </summary> - <param name="method">name of the currently invoked method.</param> - <param name="arguments">arguments used in the method template.</param> - <returns>generated string</returns> - <remarks>Creates a JavaScript Alert box if request is Ajax.</remarks> + <param name="name"></param> + <returns>Item if found; otherwise HttpInputItem.EmptyLanguageNode</returns> </member> - <member name="M:HttpServer.Controllers.ViewController.RenderErrors(System.Collections.Specialized.NameValueCollection,System.String,System.Object[])"> + <member name="T:HttpServer.HttpFile"> <summary> - Renders errors from the <see cref="P:HttpServer.Controllers.ViewController.Errors"/> property into the - current method template, or as a JavaScript alert if the request is Ajax. + Container class for posted files </summary> - <param name="errors">A collection of errors.</param> - <param name="method">name of the currently invoked method.</param> - <param name="arguments">arguments used in the method template.</param> - <returns>generated string</returns> - <remarks>Creates a JavaScript Alert box if request is Ajax.</remarks> </member> - <member name="M:HttpServer.Controllers.ViewController.RenderJavascript(System.String)"> + <member name="M:HttpServer.HttpFile.#ctor(System.String,System.String,System.String,System.String)"> <summary> - Switches content-type to "text/JavaScript" and returns content. + Creates a container for a posted file </summary> - <param name="js">JavaScript to send to the client.</param> - <returns>JavaScript</returns> + <param name="name">The identifier of the post field</param> + <param name="filename">The file path</param> + <param name="contentType">The content type of the file</param> + <param name="uploadFilename">The name of the file uploaded</param> + <exception cref="T:System.ArgumentNullException">If any parameter is null or empty</exception> </member> - <member name="M:HttpServer.Controllers.ViewController.RenderJsErrors(System.Collections.Specialized.NameValueCollection)"> + <member name="M:HttpServer.HttpFile.#ctor(System.String,System.String,System.String)"> <summary> - Creates a JavaScript "alert" filled with all errors. + Creates a container for a posted file <see cref="M:HttpServer.HttpFile.#ctor(System.String,System.String,System.String,System.String)"/> </summary> - <param name="errors"></param> - <returns>a</returns> + <exception cref="T:System.ArgumentNullException">If any parameter is null or empty</exception> </member> - <member name="M:HttpServer.Controllers.ViewController.RenderLayout(System.String,System.String)"> + <member name="M:HttpServer.HttpFile.Finalize"> + <summary>Destructor disposing the file</summary> + </member> + <member name="M:HttpServer.HttpFile.Dispose(System.Boolean)"> <summary> - renders one of the layouts + Deletes the temporary file </summary> - <param name="layoutName">layout to render (should be found in the "views\\layouts" folder).</param> - <param name="contents">contents will be put in the template variable called "text".</param> - <returns>generated text/HTML.</returns> + <param name="disposing">True if manual dispose</param> </member> - <member name="M:HttpServer.Controllers.ViewController.RenderTemplate(System.String,System.String,System.Object[])"> + <member name="M:HttpServer.HttpFile.Dispose"> <summary> - Render a template. + Disposing interface, cleans up managed resources (the temporary file) and suppresses finalization </summary> - <remarks>Merges the Arguments property with the <c>args</c> parameter and pass those to the template.</remarks> - <param name="controller">controller name are used as a folder name when looking for the template.</param> - <param name="method">method are used as filename when looking for the template.</param> - <param name="args">arguments that should be passed to the template.</param> - <returns></returns> </member> - <member name="M:HttpServer.Controllers.ViewController.SetupRequest(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> + <member name="P:HttpServer.HttpFile.Name"> <summary> - Invoked each time a new request is about to be invoked. + The name/id of the file </summary> - <remarks>Can be used to clear old data.</remarks> - <param name="request"></param> - <param name="response"></param> - <param name="session"></param> </member> - <member name="P:HttpServer.Controllers.ViewController.Arguments"> + <member name="P:HttpServer.HttpFile.Filename"> <summary> - Arguments that are being used in the templates. + The full file path </summary> </member> - <member name="P:HttpServer.Controllers.ViewController.Errors"> + <member name="P:HttpServer.HttpFile.UploadFilename"> <summary> - A set of errors that occurred during request processing. - Key should be argument name (if argument error, otherwise <see cref="F:System.String.Empty"/>), value should be - the error message. + The name of the uploaded file </summary> - <remarks>Errors can be rendered into templates using the <see cref="M:HttpServer.Helpers.WebHelper.Errors(System.Collections.Specialized.NameValueCollection)"/> method.</remarks> - <seealso cref="T:HttpServer.Helpers.WebHelper"/> </member> - <member name="P:HttpServer.Controllers.ViewController.IncludeLayoutInAjaxRequests"> + <member name="P:HttpServer.HttpFile.ContentType"> <summary> - True if we always should render contents inside page layouts when request is Ajax. + The type of file </summary> - <remarks>default is false.</remarks> </member> - <member name="P:HttpServer.Controllers.ViewController.Layout"> + <member name="T:HttpServer.HttpContextFactory"> <summary> - Which page layout to use (without file extension) + Used to create and reuse contexts. </summary> - <remarks> - <para> - Page layouts should be places in the Views\Layouts folder. - </para> - <para> - default is "Application" - </para> - </remarks> </member> - <member name="P:HttpServer.Controllers.ViewController.Title"> + <member name="T:HttpServer.IHttpContextFactory"> <summary> - Page title (are added as a parameter to the layout template, use it in <title> HTML tag. + Used to create <see cref="T:HttpServer.IHttpClientContext"/>es. </summary> </member> - <member name="T:HttpServer.Sessions.HttpSessionClearedArgs"> + <member name="M:HttpServer.IHttpContextFactory.CreateContext(System.Net.Sockets.Socket)"> <summary> - Arguments sent when a <see cref="T:HttpServer.Sessions.IHttpSession"/> is cleared + Creates a <see cref="T:HttpServer.IHttpClientContext"/> that handles a connected client. </summary> + <param name="socket">Client socket (accepted by the <see cref="T:HttpServer.HttpListener"/>).</param> + <returns>A creates <see cref="T:HttpServer.IHttpClientContext"/>.</returns> </member> - <member name="M:HttpServer.Sessions.HttpSessionClearedArgs.#ctor(System.Boolean)"> + <member name="M:HttpServer.IHttpContextFactory.CreateSecureContext(System.Net.Sockets.Socket,System.Security.Cryptography.X509Certificates.X509Certificate,System.Security.Authentication.SslProtocols)"> <summary> - Instantiates the arguments for the event + Create a secure <see cref="T:HttpServer.IHttpClientContext"/>. </summary> - <param name="expired">True if the session is cleared due to expiration</param> + <param name="socket">Client socket (accepted by the <see cref="T:HttpServer.HttpListener"/>).</param> + <param name="certificate">HTTPS certificate to use.</param> + <param name="protocol">Kind of HTTPS protocol. Usually TLS or SSL.</param> + <returns>A created <see cref="T:HttpServer.IHttpClientContext"/>.</returns> </member> - <member name="P:HttpServer.Sessions.HttpSessionClearedArgs.Expired"> + <member name="E:HttpServer.IHttpContextFactory.RequestReceived"> <summary> - Returns true if the session is cleared due to expiration + A request have been received from one of the contexts. </summary> </member> - <member name="T:HttpServer.Sessions.HttpSessionClearedHandler"> + <member name="M:HttpServer.HttpContextFactory.#ctor(HttpServer.ILogWriter,System.Int32,HttpServer.IRequestParserFactory)"> <summary> - Delegate for when a IHttpSession is cleared + Initializes a new instance of the <see cref="T:HttpServer.HttpContextFactory"/> class. </summary> - <param name="session"><see cref="T:HttpServer.Sessions.IHttpSession"/> this is being cleared.</param> - <param name="args">Arguments for the clearing</param> + <param name="writer">The writer.</param> + <param name="bufferSize">Amount of bytes to read from the incoming socket stream.</param> + <param name="factory">Used to create a request parser.</param> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.IdNode.Parse(HttpServer.Rendering.Haml.NodeList,HttpServer.Rendering.Haml.Nodes.Node,HttpServer.Rendering.Haml.LineInfo,System.Int32@)"> + <member name="M:HttpServer.HttpContextFactory.CreateContext(System.Boolean,System.Net.IPEndPoint,System.IO.Stream,System.Net.Sockets.Socket)"> <summary> - Parse node contents add return a fresh node. + Create a new context. </summary> - <param name="prototypes">List containing all node types</param> - <param name="parent">Node that this is a subnode to. Can be null</param> - <param name="line">Line to parse</param> - <param name="offset">Where to start the parsing. Should be set to where the next node should start parsing.</param> - <returns>A node corresponding to the bla bla; null if parsing failed.</returns> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException"></exception> + <param name="isSecured">true if socket is running HTTPS.</param> + <param name="endPoint">Client that connected</param> + <param name="stream">Network/SSL stream.</param> + <returns>A context.</returns> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.IdNode.CanHandle(System.String,System.Boolean)"> + <member name="M:HttpServer.HttpContextFactory.CreateNewContext(System.Boolean,System.Net.IPEndPoint,System.IO.Stream,System.Net.Sockets.Socket)"> <summary> - determines if this node can handle the line (by checking the first word); + Create a new context. </summary> - <param name="word">Controller char (word)</param> - <returns>true if text belongs to this node type</returns> - <param name="firstNode">first node on line</param> + <param name="isSecured">true if HTTPS is used.</param> + <param name="endPoint">Remote client</param> + <param name="stream">Network stream, <see cref="T:HttpServer.HttpClientContext"/> uses <see cref="T:HttpServer.ReusableSocketNetworkStream"/>.</param> + <returns>A new context (always).</returns> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.IdNode.ToHtml"> + <member name="M:HttpServer.HttpContextFactory.CreateSecureContext(System.Net.Sockets.Socket,System.Security.Cryptography.X509Certificates.X509Certificate,System.Security.Authentication.SslProtocols)"> <summary> - Convert node to HTML (with ASP-tags) + Create a secure <see cref="T:HttpServer.IHttpClientContext"/>. </summary> - <returns>HTML string</returns> + <param name="socket">Client socket (accepted by the <see cref="T:HttpServer.HttpListener"/>).</param> + <param name="certificate">HTTPS certificate to use.</param> + <param name="protocol">Kind of HTTPS protocol. Usually TLS or SSL.</param> + <returns> + A created <see cref="T:HttpServer.IHttpClientContext"/>. + </returns> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.IdNode.ToCode(System.Boolean@,System.Boolean,System.Boolean)"> + <member name="M:HttpServer.HttpContextFactory.CreateContext(System.Net.Sockets.Socket)"> <summary> - Convert the node to c# code + Creates a <see cref="T:HttpServer.IHttpClientContext"/> that handles a connected client. </summary> - <param name="inString">True if we are inside the internal stringbuilder</param> - <param name="smallEnough">true if all subnodes fit on one line</param> - <param name="smallEnoughIsDefaultValue">smallEnough is a default value, recalc it</param> - <returns>c# code</returns> + <param name="socket">Client socket (accepted by the <see cref="T:HttpServer.HttpListener"/>).</param> + <returns> + A creates <see cref="T:HttpServer.IHttpClientContext"/>. + </returns> </member> - <member name="T:HttpServer.Rendering.Haml.NodeList"> - <summary> - A list of prototype nodes. + <member name="P:HttpServer.HttpContextFactory.UseTraceLogs"> + <summary> + True if detailed trace logs should be written. + </summary> + </member> + <member name="E:HttpServer.HttpContextFactory.RequestReceived"> + <summary> + A request have been received from one of the contexts. </summary> </member> - <member name="M:HttpServer.Rendering.Haml.NodeList.CreateNode(System.String,HttpServer.Rendering.Haml.Nodes.Node)"> + <member name="T:HttpServer.ReusableSocketNetworkStream"> <summary> - Creates the node. + Custom network stream to mark sockets as reusable when disposing the stream. </summary> - <param name="word">node identifier.</param> - <param name="parent">parent node.</param> - <returns>created node if identifier was found; otherwise null.</returns> </member> - <member name="M:HttpServer.Rendering.Haml.NodeList.GetPrototype(System.String,System.Boolean)"> + <member name="M:HttpServer.ReusableSocketNetworkStream.#ctor(System.Net.Sockets.Socket)"> <summary> - + Creates a new instance of the <see cref="T:System.Net.Sockets.NetworkStream" /> class for the specified <see cref="T:System.Net.Sockets.Socket" />. </summary> - <param name="word"></param> - <param name="firstNode">first node on line</param> - <returns></returns> + <param name="socket"> + The <see cref="T:System.Net.Sockets.Socket" /> that the <see cref="T:System.Net.Sockets.NetworkStream" /> will use to send and receive data. + </param> + <exception cref="T:System.ArgumentNullException"> + The <paramref name="socket" /> parameter is null. + </exception> + <exception cref="T:System.IO.IOException"> + The <paramref name="socket" /> parameter is not connected. + -or- + The <see cref="P:System.Net.Sockets.Socket.SocketType" /> property of the <paramref name="socket" /> parameter is not <see cref="F:System.Net.Sockets.SocketType.Stream" />. + -or- + The <paramref name="socket" /> parameter is in a nonblocking state. + </exception> </member> - <member name="M:HttpServer.Rendering.Haml.NodeList.Add(HttpServer.Rendering.Haml.Nodes.Node)"> + <member name="M:HttpServer.ReusableSocketNetworkStream.#ctor(System.Net.Sockets.Socket,System.Boolean)"> <summary> - Add a prototype + Initializes a new instance of the <see cref="T:System.Net.Sockets.NetworkStream" /> class for the specified <see cref="T:System.Net.Sockets.Socket" /> with the specified <see cref="T:System.Net.Sockets.Socket" /> ownership. </summary> - <param name="node">prototype node</param> + <param name="socket"> + The <see cref="T:System.Net.Sockets.Socket" /> that the <see cref="T:System.Net.Sockets.NetworkStream" /> will use to send and receive data. + </param> + <param name="ownsSocket"> + Set to true to indicate that the <see cref="T:System.Net.Sockets.NetworkStream" /> will take ownership of the <see cref="T:System.Net.Sockets.Socket" />; otherwise, false. + </param> + <exception cref="T:System.ArgumentNullException"> + The <paramref name="socket" /> parameter is null. + </exception> + <exception cref="T:System.IO.IOException"> + The <paramref name="socket" /> parameter is not connected. + -or- + the value of the <see cref="P:System.Net.Sockets.Socket.SocketType" /> property of the <paramref name="socket" /> parameter is not <see cref="F:System.Net.Sockets.SocketType.Stream" />. + -or- + the <paramref name="socket" /> parameter is in a nonblocking state. + </exception> </member> - <member name="T:HttpServer.HttpModules.FileModule"> + <member name="M:HttpServer.ReusableSocketNetworkStream.#ctor(System.Net.Sockets.Socket,System.IO.FileAccess)"> <summary> - The purpose of this module is to serve files. + Creates a new instance of the <see cref="T:System.Net.Sockets.NetworkStream" /> class for the specified <see cref="T:System.Net.Sockets.Socket" /> with the specified access rights. </summary> + <param name="socket"> + The <see cref="T:System.Net.Sockets.Socket" /> that the <see cref="T:System.Net.Sockets.NetworkStream" /> will use to send and receive data. + </param> + <param name="access"> + A bitwise combination of the <see cref="T:System.IO.FileAccess" /> values that specify the type of access given to the <see cref="T:System.Net.Sockets.NetworkStream" /> over the provided <see cref="T:System.Net.Sockets.Socket" />. + </param> + <exception cref="T:System.ArgumentNullException"> + The <paramref name="socket" /> parameter is null. + </exception> + <exception cref="T:System.IO.IOException"> + The <paramref name="socket" /> parameter is not connected. + -or- + the <see cref="P:System.Net.Sockets.Socket.SocketType" /> property of the <paramref name="socket" /> parameter is not <see cref="F:System.Net.Sockets.SocketType.Stream" />. + -or- + the <paramref name="socket" /> parameter is in a nonblocking state. + </exception> </member> - <member name="M:HttpServer.HttpModules.FileModule.#ctor(System.String,System.String,System.Boolean)"> + <member name="M:HttpServer.ReusableSocketNetworkStream.#ctor(System.Net.Sockets.Socket,System.IO.FileAccess,System.Boolean)"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.HttpModules.FileModule"/> class. + Creates a new instance of the <see cref="T:System.Net.Sockets.NetworkStream" /> class for the specified <see cref="T:System.Net.Sockets.Socket" /> with the specified access rights and the specified <see cref="T:System.Net.Sockets.Socket" /> ownership. </summary> - <param name="baseUri">Uri to serve, for instance "/files/"</param> - <param name="basePath">Path on hard drive where we should start looking for files</param> - <param name="useLastModifiedHeader">If true a Last-Modifed header will be sent upon requests urging webbrowser to cache files</param> + <param name="socket"> + The <see cref="T:System.Net.Sockets.Socket" /> that the <see cref="T:System.Net.Sockets.NetworkStream" /> will use to send and receive data. + </param> + <param name="access"> + A bitwise combination of the <see cref="T:System.IO.FileAccess" /> values that specifies the type of access given to the <see cref="T:System.Net.Sockets.NetworkStream" /> over the provided <see cref="T:System.Net.Sockets.Socket" />. + </param> + <param name="ownsSocket"> + Set to true to indicate that the <see cref="T:System.Net.Sockets.NetworkStream" /> will take ownership of the <see cref="T:System.Net.Sockets.Socket" />; otherwise, false. + </param> + <exception cref="T:System.ArgumentNullException"> + The <paramref name="socket" /> parameter is null. + </exception> + <exception cref="T:System.IO.IOException"> + The <paramref name="socket" /> parameter is not connected. + -or- + The <see cref="P:System.Net.Sockets.Socket.SocketType" /> property of the <paramref name="socket" /> parameter is not <see cref="F:System.Net.Sockets.SocketType.Stream" />. + -or- + The <paramref name="socket" /> parameter is in a nonblocking state. + </exception> </member> - <member name="M:HttpServer.HttpModules.FileModule.#ctor(System.String,System.String)"> + <member name="M:HttpServer.ReusableSocketNetworkStream.Close"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.HttpModules.FileModule"/> class. - </summary> - <param name="baseUri">Uri to serve, for instance "/files/"</param> - <param name="basePath">Path on hard drive where we should start looking for files</param> + Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. + </summary> </member> - <member name="M:HttpServer.HttpModules.FileModule.AddDefaultMimeTypes"> + <member name="M:HttpServer.ReusableSocketNetworkStream.Dispose(System.Boolean)"> + <summary> + Releases the unmanaged resources used by the <see cref="T:System.Net.Sockets.NetworkStream"/> and optionally releases the managed resources. + </summary> + <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param> + </member> + <member name="T:HttpServer.FormDecoders.MultipartDecoder"> <summary> - Mimtypes that this class can handle per default + </summary> + <remarks> + http://www.faqs.org/rfcs/rfc1867.html + </remarks> </member> - <member name="M:HttpServer.HttpModules.FileModule.CanHandle(System.Uri)"> + <member name="F:HttpServer.FormDecoders.MultipartDecoder.MimeType"> <summary> - Determines if the request should be handled by this module. - Invoked by the HttpServer + multipart/form-data </summary> - <param name="uri"></param> - <returns>true if this module should handle it.</returns> </member> - <member name="M:HttpServer.HttpModules.FileModule.Contains(System.String,System.Collections.Generic.IEnumerable{System.String})"> + <member name="F:HttpServer.FormDecoders.MultipartDecoder.FormData"> <summary> - check if source contains any of the chars. + form-data </summary> - <param name="source"></param> - <param name="chars"></param> - <returns></returns> </member> - <member name="M:HttpServer.HttpModules.FileModule.Process(HttpServer.IHttpRequest,HttpServer.IHttpResponse,HttpServer.Sessions.IHttpSession)"> + <member name="M:HttpServer.FormDecoders.MultipartDecoder.Decode(System.IO.Stream,System.String,System.Text.Encoding)"> <summary> - Method that process the url + </summary> - <param name="request">Information sent by the browser about the request</param> - <param name="response">Information that is being sent back to the client.</param> - <param name="session">Session used to </param> + <param name="stream">Stream containing the content</param> + <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case</param> + <param name="encoding">Stream enconding</param> + <returns>A http form, or null if content could not be parsed.</returns> + <exception cref="T:System.IO.InvalidDataException">If contents in the stream is not valid input data.</exception> + <exception cref="T:System.ArgumentNullException">If any parameter is null</exception> </member> - <member name="M:HttpServer.HttpModules.FileModule.GetFileExtension(System.String)"> + <member name="M:HttpServer.FormDecoders.MultipartDecoder.CanParse(System.String)"> <summary> - return a file extension from an absolute uri path (or plain filename) + Checks if the decoder can handle the mime type </summary> - <param name="uri"></param> - <returns></returns> + <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case.</param> + <returns>True if the decoder can parse the specified content type</returns> </member> - <member name="P:HttpServer.HttpModules.FileModule.MimeTypes"> + <member name="T:HttpServer.Sessions.MemorySession"> <summary> - List with all mime-type that are allowed. + A session stored in memory. </summary> - <remarks>All other mime types will result in a Forbidden http status code.</remarks> </member> - <member name="P:HttpServer.HttpModules.FileModule.ForbiddenChars"> + <member name="M:HttpServer.Sessions.MemorySession.#ctor(System.String)"> <summary> - characters that may not exist in a path. + </summary> - <example> - fileMod.ForbiddenChars = new string[]{ "\\", "..", ":" }; - </example> + <param name="id">A unique id used by the sessions store to identify the session</param> </member> - <member name="T:HttpServer.HttpHelper"> + <member name="M:HttpServer.Sessions.MemorySession.SetId(System.String)"> <summary> - Generic helper functions for Http + Id </summary> + <param name="id"></param> </member> - <member name="F:HttpServer.HttpHelper.HTTP10"> + <member name="M:HttpServer.Sessions.MemorySession.Clear"> <summary> - Version string for HTTP v1.0 + Remove everything from the session </summary> </member> - <member name="F:HttpServer.HttpHelper.HTTP11"> + <member name="M:HttpServer.Sessions.MemorySession.Clear(System.Boolean)"> <summary> - Version string for HTTP v1.1 + Clears the specified expire. </summary> + <param name="expires">True if the session is cleared due to expiration</param> </member> - <member name="F:HttpServer.HttpHelper.EmptyUri"> + <member name="M:HttpServer.Sessions.MemorySession.Dispose"> <summary> - An empty url + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. </summary> + <filterpriority>2</filterpriority> </member> - <member name="M:HttpServer.HttpHelper.ParseQueryString(System.String)"> + <member name="P:HttpServer.Sessions.MemorySession.Id"> <summary> - Parses a querystring. + Session id </summary> - <param name="queryString">Querystring (url decoded)</param> - <returns>A HttpInput object if successful; otherwise HttpInput.Empty</returns> </member> - <member name="T:HttpServer.Exceptions.ForbiddenException"> + <member name="P:HttpServer.Sessions.MemorySession.Item(System.String)"> <summary> - The server understood the request, but is refusing to fulfill it. - Authorization will not help and the request SHOULD NOT be repeated. - If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, - it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information - available to the client, the status code 404 (Not Found) can be used instead. - - Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php + Should </summary> + <param name="name">Name of the session variable</param> + <returns>null if it's not set</returns> </member> - <member name="M:HttpServer.Exceptions.ForbiddenException.#ctor(System.String)"> + <member name="P:HttpServer.Sessions.MemorySession.Accessed"> <summary> - Initializes a new instance of the <see cref="T:HttpServer.Exceptions.ForbiddenException"/> class. + when the session was last accessed. </summary> - <param name="errorMsg">error message</param> + <remarks> + Used to determine when the session should be removed. + </remarks> </member> - <member name="T:HttpServer.Authentication.AuthenticationHandler"> + <member name="P:HttpServer.Sessions.MemorySession.Count"> <summary> - Delegate used to let authentication modules authenticate the username and password. + Number of values in the session </summary> - <param name="realm">Realm that the user want to authenticate in</param> - <param name="userName">Username specified by client</param> - <param name="password">Password supplied by the delagete</param> - <param name="login">object that will be stored in a session variable called <see cref="F:HttpServer.Authentication.AuthModule.AuthenticationTag"/> if authentication was successful.</param> - <exception cref="T:HttpServer.Exceptions.ForbiddenException">throw forbidden exception if too many attempts have been made.</exception> </member> - <member name="T:HttpServer.Authentication.AuthRequiredDelegate"> + <member name="P:HttpServer.Sessions.MemorySession.Changed"> <summary> - Let's you decide on a system level if authentication is requried. - You can also decide if authentication is required in each HttpModule. + Flag to indicate that the session have been changed + and should be saved into the session store. </summary> - <param name="request">Http request from client</param> - <returns>true if user should be authenticated.</returns> - <remarks>throw ForbiddenException if no more attempts are allowed.</remarks> - <exception cref="T:HttpServer.Exceptions.ForbiddenException">If no more attempts are allowed</exception> </member> - <member name="T:HttpServer.Rendering.Haml.Nodes.ClassNode"> + <member name="E:HttpServer.Sessions.MemorySession.BeforeClear"> <summary> - Represents a html class node. + Event triggered upon clearing the session </summary> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.ClassNode.Parse(HttpServer.Rendering.Haml.NodeList,HttpServer.Rendering.Haml.Nodes.Node,HttpServer.Rendering.Haml.LineInfo,System.Int32@)"> + <member name="T:HttpServer.ResponseCookies"> <summary> - Parse node contents add return a fresh node. + Cookies that should be set. </summary> - <param name="prototypes">List containing all node types</param> - <param name="parent">Node that this is a subnode to. Can be null</param> - <param name="line">Line to parse</param> - <param name="offset">Where to start the parsing. Should be set to where the next node should start parsing.</param> - <returns>A node corresponding to the bla bla; null if parsing failed.</returns> - <exception cref="T:HttpServer.Rendering.CodeGeneratorException"></exception> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.ClassNode.CanHandle(System.String,System.Boolean)"> + <member name="M:HttpServer.ResponseCookies.Add(HttpServer.ResponseCookie)"> <summary> - determines if this node can handle the line (by checking the first word); + Adds a cookie in the collection. </summary> - <param name="word">Controller char (word)</param> - <returns>true if text belongs to this node type</returns> - <param name="firstNode">first node on line</param> + <param name="cookie">cookie to add</param> + <exception cref="T:System.ArgumentNullException">cookie is null</exception> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.ClassNode.ToHtml"> + <member name="M:HttpServer.ResponseCookies.Add(HttpServer.RequestCookie,System.DateTime)"> <summary> - Convert node to HTML (with ASP-tags) + Copy a request cookie </summary> - <returns>HTML string</returns> + <param name="cookie"></param> + <param name="expires">When the cookie should expire</param> </member> - <member name="M:HttpServer.Rendering.Haml.Nodes.ClassNode.ToCode(System.Boolean@,System.Boolean,System.Boolean)"> + <member name="M:HttpServer.ResponseCookies.GetEnumerator"> <summary> - Convert the node to c# code + Gets a collection enumerator on the cookie list. </summary> - <param name="inString">True if we are inside the internal stringbuilder</param> - <param name="smallEnough">true if all subnodes fit on one line</param> - <param name="smallEnoughIsDefaultValue">smallEnough is a default value, recalc it</param> - <returns>c# code</returns> + <returns>collection enumerator</returns> </member> - <member name="T:HttpServer.FormDecoders.MultipartDecoder"> + <member name="M:HttpServer.ResponseCookies.Clear"> <summary> - + Remove all cookies </summary> - <remarks> - http://www.faqs.org/rfcs/rfc1867.html - </remarks> </member> - <member name="F:HttpServer.FormDecoders.MultipartDecoder.MimeType"> + <member name="M:HttpServer.ResponseCookies.System#Collections#Generic#IEnumerable{HttpServer#ResponseCookie}#GetEnumerator"> <summary> - multipart/form-data + Returns an enumerator that iterates through the collection. </summary> + + <returns> + A <see cref="T:System.Collections.Generic.IEnumerator`1"></see> that can be used to iterate through the collection. + </returns> + <filterpriority>1</filterpriority> </member> - <member name="F:HttpServer.FormDecoders.MultipartDecoder.FormData"> + <member name="P:HttpServer.ResponseCookies.Count"> <summary> - form-data + Gets the count of cookies in the collection. </summary> </member> - <member name="M:HttpServer.FormDecoders.MultipartDecoder.Decode(System.IO.Stream,System.String,System.Text.Encoding)"> + <member name="P:HttpServer.ResponseCookies.Item(System.String)"> <summary> - + Gets the cookie of a given identifier (null if not existing). </summary> - <param name="stream">Stream containing the content</param> - <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case</param> - <param name="encoding">Stream enconding</param> - <returns>A http form, or null if content could not be parsed.</returns> - <exception cref="T:System.IO.InvalidDataException">If contents in the stream is not valid input data.</exception> - <exception cref="T:System.ArgumentNullException">If any parameter is null</exception> </member> - <member name="M:HttpServer.FormDecoders.MultipartDecoder.CanParse(System.String)"> + <member name="T:HttpServer.RequestParserFactory"> <summary> - Checks if the decoder can handle the mime type + Creates request parsers when needed. </summary> - <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case.</param> - <returns>True if the decoder can parse the specified content type</returns> </member> - <member name="M:HttpServer.FormDecoders.HttpMultipart.ReadLine"> + <member name="T:HttpServer.IRequestParserFactory"> <summary> - + Creates request parsers when needed. </summary> - <returns></returns> - <exception cref="T:System.ArgumentOutOfRangeException"></exception> - <exception cref="T:System.ObjectDisposedException"></exception> - </member> - <member name="T:HttpServer.FormDecoders.HttpMultipart.Element"> - <summary>Represents a field in a multipart form</summary> </member> - <member name="T:HttpServer.ContentType"> + <member name="M:HttpServer.IRequestParserFactory.CreateParser(HttpServer.ILogWriter)"> <summary> - Lists content type mime types. + Create a new request parser. </summary> + <param name="logWriter">Used when logging should be enabled.</param> + <returns>A new request parser.</returns> </member> - <member name="F:HttpServer.ContentType.Text"> + <member name="M:HttpServer.RequestParserFactory.CreateParser(HttpServer.ILogWriter)"> <summary> - text/plain + Create a new request parser. </summary> + <param name="logWriter">Used when logging should be enabled.</param> + <returns>A new request parser.</returns> </member> - <member name="F:HttpServer.ContentType.Html"> + <member name="M:HttpServer.ComponentProvider.AddInstance``1(System.Object)"> <summary> - text/haml + Add a component instance </summary> + <typeparam name="T">Interface type</typeparam> + <param name="instance">Instance to add</param> </member> - <member name="F:HttpServer.ContentType.Javascript"> + <member name="M:HttpServer.ComponentProvider.Get``1"> <summary> - content type for javascript documents = application/javascript + Get a component. </summary> + <typeparam name="T">Interface type</typeparam> + <returns>Component if registered, otherwise null.</returns> <remarks> - <para> - RFC 4329 states that text/javascript have been superseeded by - application/javascript. You might still want to check browser versions - since older ones do not support application/javascript. - </para> - <para>Browser support: http://krijnhoetmer.nl/stuff/javascript/mime-types/</para> + Component will get created if needed. </remarks> </member> - <member name="F:HttpServer.ContentType.Xml"> - <summary> - text/xml - </summary> + <member name="M:HttpServer.ComponentProvider.Create(HttpServer.ComponentProvider.TypeInformation)"> + <exception cref="T:System.InvalidOperationException">If instance cannot be created.</exception> </member> - <member name="T:HttpServer.ContentTypes"> + <member name="M:HttpServer.ComponentProvider.Contains(System.Type)"> <summary> - A list of content types + Checks if the specified component interface have been added. </summary> + <param name="interfaceType"></param> + <returns>true if found; otherwise false.</returns> </member> - <member name="M:HttpServer.ContentTypes.#ctor(System.String)"> + <member name="M:HttpServer.ComponentProvider.Add``2"> <summary> - + Add a component. </summary> - <param name="types">Semicolon separated content types.</param> + <typeparam name="InterfaceType">Type being requested.</typeparam> + <typeparam name="InstanceType">Type being created.</typeparam> + <exception cref="T:System.InvalidOperationException">Type have already been mapped.</exception> </member> - <member name="M:HttpServer.ContentTypes.GetEnumerator"> + <member name="T:HttpServer.Exceptions.UnauthorizedException"> <summary> - Returns an enumerator that iterates through a collection. + The request requires user authentication. The response MUST include a + WWW-Authenticate header field (section 14.47) containing a challenge + applicable to the requested resource. + + The client MAY repeat the request with a suitable Authorization header + field (section 14.8). If the request already included Authorization + credentials, then the 401 response indicates that authorization has been + refused for those credentials. If the 401 response contains the same challenge + as the prior response, and the user agent has already attempted authentication + at least once, then the user SHOULD be presented the entity that was given in the response, + since that entity might include relevant diagnostic information. + + HTTP access authentication is explained in rfc2617: + http://www.ietf.org/rfc/rfc2617.txt + + (description is taken from + http://www.submissionchamber.com/help-guides/error-codes.php#sec10.4.2) </summary> - <returns> - An <see cref="T:System.Collections.IEnumerator"/> object that can be used to iterate through the collection. - </returns> </member> - <member name="M:HttpServer.ContentTypes.Contains(System.String)"> + <member name="M:HttpServer.Exceptions.UnauthorizedException.#ctor"> <summary> - Searches for the specified type + Create a new unauhtorized exception. </summary> - <param name="type">Can also be a part of a type (searching for "xml" would return true for "application/xml").</param> - <returns>true if type was found.</returns> + <seealso cref="T:HttpServer.Exceptions.UnauthorizedException"/> </member> - <member name="P:HttpServer.ContentTypes.First"> + <member name="M:HttpServer.Exceptions.UnauthorizedException.#ctor(System.String,System.Exception)"> <summary> - Get this first content type. + Create a new unauhtorized exception. </summary> + <param name="message">reason to why the request was unauthorized.</param> + <param name="inner">inner exception</param> </member> - <member name="P:HttpServer.ContentTypes.Item(System.String)"> + <member name="M:HttpServer.Exceptions.UnauthorizedException.#ctor(System.String)"> <summary> - Fetch a content type + Create a new unauhtorized exception. </summary> - <param name="type">Part of type ("xml" would return "application/xml")</param> - <returns></returns> - <remarks>All content types are in lower case.</remarks> + <param name="message">reason to why the request was unauthorized.</param> </member> </members> </doc> -- cgit v1.1