Annotation of libwww/Library/src/HTMethod.html, revision 2.20

2.20    ! kirschpi    1: <HTML>
        !             2: <HEAD>
2.14      frystyk     3:   <!-- Changed by: Henrik Frystyk Nielsen,  1-Jul-1996 -->
2.20    ! kirschpi    4:   <TITLE>W3C Sample Code Library libwww Request Access Methods</TITLE>
        !             5: </HEAD>
        !             6: <BODY>
        !             7: <H1>
        !             8:   Request Access Methods
        !             9: </H1>
        !            10: <PRE>
        !            11: /*
2.1       frystyk    12: **     (c) COPYRIGHT MIT 1995.
                     13: **     Please first read the full copyright statement in the file COPYRIGH.
2.20    ! kirschpi   14: */
        !            15: </PRE>
        !            16: <P>
        !            17: This module keeps a list of valid methods to be performed on a
        !            18: <A HREF="HTReq.html">request object</A>, for example <B>GET</B>, <B>HEAD</B>,
        !            19: <B>PUT</B>, <B>POST</B>, <B>DELETE</B>, etc.&nbsp;You can assign which method
        !            20: to be performed on the request object <A HREF="HTReq.html">directly</A> or
        !            21: you can go through the <A HREF="HTReq.html">Access module</A> for higher
        !            22: level functions.
        !            23: <P>
        !            24: This module is implemented by <A HREF="HTMethod.c">HTMethod.c</A>, and it
        !            25: is a part of the <A HREF="http://www.w3.org/Library/"> W3C Sample Code
        !            26: Library</A>.
        !            27: <PRE>
        !            28: #ifndef HTMETHOD_H
        !            29: #define HTMETHOD_H
        !            30: 
        !            31: </PRE>
        !            32: <P>
        !            33: <B>NOTE:</B> The anchor list of allowed methods is a bitflag, not at list!
        !            34: <PRE>
        !            35: typedef enum {
2.1       frystyk    36:     METHOD_INVALID     = 0x0,
                     37:     METHOD_GET         = 0x1,
                     38:     METHOD_HEAD                = 0x2,    
                     39:     METHOD_POST                = 0x4,    
2.13      frystyk    40:     METHOD_PUT         = 0x8,
                     41:     METHOD_PATCH       = 0x10,
                     42:     METHOD_DELETE      = 0x20,
                     43:     METHOD_TRACE       = 0x40,
                     44:     METHOD_OPTIONS     = 0x80,
                     45:     METHOD_LINK                = 0x100,
2.17      kirschpi   46: 
                     47: #ifdef HT_DAV
                     48:     METHOD_LOCK         = 0x400,              /* WebDAV Methods */
                     49:     METHOD_UNLOCK       = 0x800,
                     50: 
                     51:     METHOD_PROPFIND     = 0x1000,
                     52:     METHOD_PROPPATCH    = 0x2000,
                     53:     METHOD_MKCOL        = 0x4000,
                     54:     METHOD_COPY         = 0x8000,
                     55:     METHOD_MOVE         = 0x10000,
                     56: #endif
                     57: 
                     58: #ifdef HT_EXT
                     59:     METHOD_EXT_0        = 0x20000,            /* Extension methods */
                     60:     METHOD_EXT_1        = 0x40000,    
                     61:     METHOD_EXT_2        = 0x80000,
                     62:     METHOD_EXT_3        = 0x100000,
                     63:     METHOD_EXT_4        = 0x200000,
                     64:     METHOD_EXT_5        = 0x400000,
                     65:     METHOD_EXT_6        = 0x800000,
                     66: #endif
2.20    ! kirschpi   67: 
2.13      frystyk    68:     METHOD_UNLINK      = 0x200
2.20    ! kirschpi   69: } HTMethod;
        !            70: </PRE>
        !            71: <H3>
        !            72:   Get Method Enumeration
        !            73: </H3>
        !            74: <P>
        !            75: Gives the enumeration value of the method as a function of the (char *) name.
        !            76: <PRE>
        !            77: extern HTMethod HTMethod_enum (const char * name);
        !            78: </PRE>
        !            79: <H3>
        !            80:   Get Method String
        !            81: </H3>
        !            82: <P>
        !            83: The reverse of <I>HTMethod_enum()</I>
        !            84: <PRE>
        !            85: extern const char * HTMethod_name (HTMethod method);
        !            86: </PRE>
        !            87: <H3>
        !            88:   Is Method "Safe"?
        !            89: </H3>
        !            90: <P>
        !            91: If a method is safe, it doesn't produce any side effects on the server
        !            92: <PRE>
        !            93: #define HTMethod_isSafe(me)    ((me) &amp; (METHOD_GET|METHOD_HEAD))
        !            94: </PRE>
        !            95: <H3>
        !            96:   Does the Method Replace or Add to Metainformation
        !            97: </H3>
        !            98: <P>
        !            99: Most methods override the current set of metainformation stored in an
        !           100: <A HREF="HTAnchor.html">anchor</A>. However, a few methods actually only
        !           101: add to the anchor metainformation. We have a small macro to make the distinction.
        !           102: <PRE>
        !           103: #define HTMethod_addMeta(me)  ((me) &amp; (METHOD_TRACE | METHOD_OPTIONS))
        !           104: </PRE>
        !           105: <H3>
        !           106:   Does a Method include Entity?
        !           107: </H3>
        !           108: <P>
        !           109: Does a method include an entity to be sent from the client to the server?
        !           110: <P>
        !           111: If not using WebDAV functions, neither extension methods, the
2.17      kirschpi  112: HTMethod_hasEntity is not changed, because a macro is much more performant
                    113: than a function. The function is interesting only when using WebDAV (many
                    114: methods) or extension methods (in this case, a dynamic structure is
2.20    ! kirschpi  115: needed).
        !           116: <PRE>
2.18      kirschpi  117: extern BOOL HTMethod_hasEntity(HTMethod me);
2.20    ! kirschpi  118: </PRE>
        !           119: <H3>
        !           120: Extension Methods
        !           121: </H3>
2.17      kirschpi  122: 
2.20    ! kirschpi  123: <P>
        !           124: These methods have been introduced in Libwww for extension purposes.
2.17      kirschpi  125: Through these methods, application may register new methods, even libwww
                    126: unknown methods, and use them. It's recomended for applications that need
                    127: only a few new methods, that aren't yet in the libwww. The application should
                    128: register the desired methos, an before finish, it must unregister these
2.20    ! kirschpi  129: methods.
        !           130: <PRE>
2.17      kirschpi  131: extern BOOL HTMethod_setExtensionMethod (HTMethod method, const char * name, BOOL hasEntity);
                    132: extern BOOL HTMethod_deleteExtensionMethod (HTMethod method);
2.20    ! kirschpi  133: </PRE>
2.17      kirschpi  134: 
2.20    ! kirschpi  135: <PRE>
        !           136: #endif /* HTMETHOD_H */
        !           137: </PRE>
        !           138: <P>
        !           139:   <HR>
        !           140: <ADDRESS>
        !           141:   @(#) $Id: HTMethod.html,v 2.16 1998/05/14 02:10:45 frystyk Exp $
        !           142: </ADDRESS>
        !           143: </BODY></HTML>

Webmaster