1% ---------------------------------------------------------------------- 2% BEGIN LICENSE BLOCK 3% Version: CMPL 1.1 4% 5% The contents of this file are subject to the Cisco-style Mozilla Public 6% License Version 1.1 (the "License"); you may not use this file except 7% in compliance with the License. You may obtain a copy of the License 8% at www.eclipse-clp.org/license. 9% 10% Software distributed under the License is distributed on an "AS IS" 11% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 12% the License for the specific language governing rights and limitations 13% under the License. 14% 15% The Original Code is The ECLiPSe Constraint Logic Programming System. 16% The Initial Developer of the Original Code is Cisco Systems, Inc. 17% Portions created by the Initial Developer are 18% Copyright (C) 1991-2006 Cisco Systems, Inc. All Rights Reserved. 19% 20% Contributor(s): ECRC GmbH 21% Contributor(s): IC-Parc, Imperal College London 22% 23% END LICENSE BLOCK 24% 25% System: ECLiPSe Constraint Logic Programming System 26% Version: $Id: http.pl,v 1.2 2009/07/16 09:11:24 jschimpf Exp $ 27% ---------------------------------------------------------------------- 28 29:- module(http). 30 31:- comment(categories, ["Interfacing"]). 32:- comment(summary, "HTTP library"). 33:- comment(author, "Ph. Bonnet, S. Bressan and M. Meier, ECRC Munich"). 34:- comment(copyright, "Cisco Systems, Inc"). 35:- comment(date, "$Date: 2009/07/16 09:11:24 $"). 36:- comment(desc, html(" 37 The HTTP library contains an extensible server and a client for the 38 Hyper Text Transfer Protocol. The library is entirely written in ECLiPSe. 39 <P> 40 Typical use of the client is for building WWW \"Worms\", WWW 41 \"Robots\" or customized WWW browsers. Typical use of the server is 42 for building customized servers, e.g. dynamic generation of HTML 43 pages. The server and the client can typically be used together 44 to build proxy servers. 45 <P> 46 Limitations and Bugs: 47 <UL> 48 <LI> The current version of the server is sequential. 49 <LI> The MIME and HTTP grammar is not complete and may fail 50 parsing some sentences generated by existing browsers and servers. 51 </UL> 52 The library consists of two sub-modules, http_client and http_server, 53 which can also be loaded separately. 54 <P> 55 The structure of the HTTP messages is precisely described in the 56 specification document (http://www.w3.org/pub/WWW/Protocols/). An 57 augmented BNF is provided for each component of the header. We 58 have used the DCG (Definite Clause Grammar) mechanism of ECLiPSe 59 to encode the grammar, that we use for both parsing (from HTTP 60 messages into Prolog terms) and pretty printing (from prolog terms 61 into HTTP messages). 62 <P> 63 This DCG grammar may have to be modified with the evolutions of 64 the HTTP protocol (standard modification and available client or 65 server implementations). 66 ")). 67 68:- reexport http_client. 69:- reexport http_server. 70