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

2.1       frystyk     1: <HTML>
                      2: <HEAD>
2.11      frystyk     3:   <TITLE>W3C Reference Library libwww Request Access Methods</TITLE>
2.13    ! frystyk     4: <!-- Changed by: Henrik Frystyk Nielsen,  1-Jul-1996 -->
2.1       frystyk     5: </HEAD>
                      6: <BODY>
2.11      frystyk     7: <H1>
                      8:   Request Access Methods
                      9: </H1>
2.1       frystyk    10: <PRE>
                     11: /*
                     12: **     (c) COPYRIGHT MIT 1995.
                     13: **     Please first read the full copyright statement in the file COPYRIGH.
                     14: */
                     15: </PRE>
2.11      frystyk    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>
2.12      frystyk    24: This module is implemented by <A HREF="HTMethod.c">HTMethod.c</A>, and it
2.11      frystyk    25: is a part of the <A HREF="http://www.w3.org/pub/WWW/Library/"> W3C Reference
                     26: Library</A>.
                     27: <PRE>#ifndef HTMETHOD_H
2.1       frystyk    28: #define HTMETHOD_H
                     29: 
                     30: </PRE>
2.11      frystyk    31: <P>
2.12      frystyk    32: <B>NOTE:</B> The anchor list of allowed methods is a bitflag, not at list!
2.1       frystyk    33: <PRE>
                     34: typedef enum {
                     35:     METHOD_INVALID     = 0x0,
                     36:     METHOD_GET         = 0x1,
                     37:     METHOD_HEAD                = 0x2,    
                     38:     METHOD_POST                = 0x4,    
2.13    ! frystyk    39:     METHOD_PUT         = 0x8,
        !            40:     METHOD_PATCH       = 0x10,
        !            41:     METHOD_DELETE      = 0x20,
        !            42:     METHOD_TRACE       = 0x40,
        !            43:     METHOD_OPTIONS     = 0x80,
        !            44:     METHOD_LINK                = 0x100,
        !            45:     METHOD_UNLINK      = 0x200
2.1       frystyk    46: } HTMethod;
                     47: </PRE>
2.11      frystyk    48: <H3>
                     49:   Get Method Enumeration
                     50: </H3>
                     51: <P>
2.1       frystyk    52: Gives the enumeration value of the method as a function of the (char *) name.
                     53: <PRE>
2.8       frystyk    54: extern HTMethod HTMethod_enum (const char * name);
2.1       frystyk    55: </PRE>
2.11      frystyk    56: <H3>
                     57:   Get Method String
                     58: </H3>
                     59: <P>
2.1       frystyk    60: The reverse of <I>HTMethod_enum()</I>
                     61: <PRE>
2.8       frystyk    62: extern const char * HTMethod_name (HTMethod method);
2.7       frystyk    63: </PRE>
2.11      frystyk    64: <H3>
2.12      frystyk    65:   Is Method "Safe"?
2.11      frystyk    66: </H3>
                     67: <P>
2.7       frystyk    68: If a method a safe, it doesn't produce any side effects on the server
                     69: <PRE>
                     70: #define HTMethod_isSafe(me)    ((me) &amp; (METHOD_GET|METHOD_HEAD))
                     71: </PRE>
2.11      frystyk    72: <H3>
2.12      frystyk    73:   Does a Method include Entity?
2.11      frystyk    74: </H3>
                     75: <P>
2.7       frystyk    76: Does a method include an entity to be sent from the client to the server?
                     77: <PRE>
                     78: #define HTMethod_hasEntity(me) ((me) &amp; (METHOD_PUT | METHOD_POST))
2.1       frystyk    79: </PRE>
                     80: <PRE>
                     81: #endif /* HTMETHOD_H */
                     82: </PRE>
2.11      frystyk    83: <P>
                     84:   <HR>
2.10      frystyk    85: <ADDRESS>
2.13    ! frystyk    86:   @(#) $Id: HTMethod.html,v 2.12 1996/06/28 16:31:18 frystyk Exp $
2.10      frystyk    87: </ADDRESS>
2.11      frystyk    88: </BODY></HTML>

Webmaster