View source with formatted comments or as raw
    1/*  Part of SWI-Prolog
    2
    3    Author:        Jan Wielemaker
    4    E-mail:        J.Wielemaker@vu.nl
    5    WWW:           http://www.swi-prolog.org
    6    Copyright (c)  2008-2015, University of Amsterdam
    7    All rights reserved.
    8
    9    Redistribution and use in source and binary forms, with or without
   10    modification, are permitted provided that the following conditions
   11    are met:
   12
   13    1. Redistributions of source code must retain the above copyright
   14       notice, this list of conditions and the following disclaimer.
   15
   16    2. Redistributions in binary form must reproduce the above copyright
   17       notice, this list of conditions and the following disclaimer in
   18       the documentation and/or other materials provided with the
   19       distribution.
   20
   21    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   22    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   23    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
   24    FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
   25    COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
   26    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
   27    BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   28    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   29    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   30    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
   31    ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   32    POSSIBILITY OF SUCH DAMAGE.
   33*/
   34
   35:- module(http_hook,
   36          []).   37
   38/** <module> HTTP library hooks
   39
   40Get the declarations of the HTTP package using
   41
   42    ==
   43    :- use_module(library(http/http_hook)).
   44    ==
   45
   46@tbd    This should be using include, but then it cannot be a module
   47        and this would cause more overhead in SWI-Prolog
   48@tbd    Complete this and document the hooks.
   49*/
   50
   51                 /*******************************
   52                 *           HTTP-PATH          *
   53                 *******************************/
   54
   55:- multifile http:location/3.   56:- dynamic   http:location/3.   57
   58
   59                 /*******************************
   60                 *           HTML-WRITE         *
   61                 *******************************/
   62
   63:- multifile
   64    html_write:expand//1,
   65    html_write:expand_attribute_value//1,
   66    html_write:html_head_expansion/2,
   67    html_write:layout/3.   68
   69
   70                 /*******************************
   71                 *         HTTP-DISPATCH        *
   72                 *******************************/
   73
   74:- multifile
   75    http:authenticate/3.   76
   77
   78                 /*******************************
   79                 *       HTTP-PARAMETERS        *
   80                 *******************************/
   81
   82%!  http:convert_parameter(+Type, +ValueIn, -ValueOut) is semidet.
   83%
   84%   Hook to execute a step in the HTTP parameter conversion process.
   85%
   86%   @see http_parameters:check_type/4.
   87
   88:- multifile
   89    http:convert_parameter/3.   90
   91
   92                 /*******************************
   93                 *            PROXIES           *
   94                 *******************************/
   95
   96%!  http:http_connection_over_proxy(+Proxy, +URLParts, +Endpoint,
   97%!                                  -StreamPair, +Options, -NewOptions).
   98%
   99%   Try to connect to the host Endpoint   via Proxy for the purposes
  100%   of retrieving the resource  identified   by  URLParts. Different
  101%   options can be returned in NewOptions,  which may be required if
  102%   you   have   defined   a   non-standard     proxy    method   in
  103%   socket:proxy_for_url/3 (such as one requiring authentication)
  104
  105:- multifile
  106    http:http_connection_over_proxy/6.