Annotation of embedaddon/libpdel/http/servlet/http_servlet_redirect.3, revision 1.1.1.1

1.1       misho       1: .\" Copyright (c) 2001-2002 Packet Design, LLC.
                      2: .\" All rights reserved.
                      3: .\" 
                      4: .\" Subject to the following obligations and disclaimer of warranty,
                      5: .\" use and redistribution of this software, in source or object code
                      6: .\" forms, with or without modifications are expressly permitted by
                      7: .\" Packet Design; provided, however, that:
                      8: .\" 
                      9: .\"    (i)  Any and all reproductions of the source or object code
                     10: .\"         must include the copyright notice above and the following
                     11: .\"         disclaimer of warranties; and
                     12: .\"    (ii) No rights are granted, in any manner or form, to use
                     13: .\"         Packet Design trademarks, including the mark "PACKET DESIGN"
                     14: .\"         on advertising, endorsements, or otherwise except as such
                     15: .\"         appears in the above copyright notice or in the software.
                     16: .\" 
                     17: .\" THIS SOFTWARE IS BEING PROVIDED BY PACKET DESIGN "AS IS", AND
                     18: .\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, PACKET DESIGN MAKES NO
                     19: .\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING
                     20: .\" THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED
                     21: .\" WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
                     22: .\" OR NON-INFRINGEMENT.  PACKET DESIGN DOES NOT WARRANT, GUARANTEE,
                     23: .\" OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS
                     24: .\" OF THE USE OF THIS SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY,
                     25: .\" RELIABILITY OR OTHERWISE.  IN NO EVENT SHALL PACKET DESIGN BE
                     26: .\" LIABLE FOR ANY DAMAGES RESULTING FROM OR ARISING OUT OF ANY USE
                     27: .\" OF THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY DIRECT,
                     28: .\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE, OR CONSEQUENTIAL
                     29: .\" DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF
                     30: .\" USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY THEORY OF
                     31: .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
                     32: .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
                     33: .\" THE USE OF THIS SOFTWARE, EVEN IF PACKET DESIGN IS ADVISED OF
                     34: .\" THE POSSIBILITY OF SUCH DAMAGE.
                     35: .\"
                     36: .\" Author: Archie Cobbs <archie@freebsd.org>
                     37: .\"
                     38: .\" $Id: http_servlet_redirect.3,v 1.9 2004/06/02 17:24:37 archie Exp $
                     39: .\"
                     40: .Dd April 22, 2002
                     41: .Dt HTTP_SERVLET_REDIRECT 3
                     42: .Os
                     43: .Sh NAME
                     44: .Nm http_servlet_redirect
                     45: .Nd HTTP redirect servlet
                     46: .Sh LIBRARY
                     47: PDEL Library (libpdel, \-lpdel)
                     48: .Sh SYNOPSIS
                     49: .In sys/types.h
                     50: .In stdio.h
                     51: .In netinet/in.h
                     52: .In openssl/ssl.h
                     53: .In pdel/http/http_defs.h
                     54: .In pdel/http/http_server.h
                     55: .In pdel/http/servlet/redirect.h
                     56: .Ft "struct http_servlet *"
                     57: .Fn http_servlet_redirect_create "const char *url" "int append_url"
                     58: .Sh DESCRIPTION
                     59: .Fn http_servlet_redirect_create
                     60: creates a new servlet that responds to all queries with an HTTP
                     61: "302 Found" status code and supplies the new redirect URL
                     62: .Fa url
                     63: in the "Location" header.
                     64: This causes the client to retry the transaction at the new URL.
                     65: .Pp
                     66: The
                     67: .Fa append_url
                     68: argument determines whether and how the originally requested URL is
                     69: included in the redirect URL and may equal one of the following:
                     70: .Bl -tag -width 2n -offset 3n
                     71: .It Dv HTTP_SERVLET_REDIRECT_NO_APPEND
                     72: .Fa url
                     73: is always returned unmodified;
                     74: the originally requested URL is discarded.
                     75: .It Dv HTTP_SERVLET_REDIRECT_APPEND_QUERY
                     76: The query string component of the originally requested URL is appended to
                     77: .Fa url
                     78: as additional query string argument(s).
                     79: .It Dv HTTP_SERVLET_REDIRECT_APPEND_URI
                     80: This causes the path and query string components of the originally
                     81: requested URL (i.e., the URI) to be appended to
                     82: .Fa url ,
                     83: in effect mapping the original URL into the corresponding "subdirectory" of
                     84: .Fa url .
                     85: .It Dv HTTP_SERVLET_REDIRECT_APPEND_URL
                     86: The originally requested URL is URL-encoded and appended as an additional
                     87: query string argument to the redirect URL
                     88: .Fa url .
                     89: This is useful for example when redirecting to a login page that will
                     90: redirect back to the originally requested URL after a successful login.
                     91: .El
                     92: .Sh RETURN VALUES
                     93: On failure,
                     94: .Fn http_servlet_redirect_create
                     95: returns
                     96: .Dv NULL
                     97: and sets
                     98: .Va errno
                     99: to an appropriate value.
                    100: .Sh SEE ALSO
                    101: .Xr http_request 3 ,
                    102: .Xr http_response 3 ,
                    103: .Xr http_server 3 ,
                    104: .Xr http_servlet 3 ,
                    105: .Xr libpdel 3
                    106: .Sh HISTORY
                    107: The PDEL library was developed at Packet Design, LLC.
                    108: .Dv "http://www.packetdesign.com/"
                    109: .Sh AUTHORS
                    110: .An Archie Cobbs Aq archie@freebsd.org

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>