Annotation of libwww/Library/src/HTMethod.html, revision 2.14
2.1 frystyk 1: <HTML>
2: <HEAD>
2.14 ! frystyk 3: <!-- Changed by: Henrik Frystyk Nielsen, 1-Jul-1996 -->
2.11 frystyk 4: <TITLE>W3C Reference Library libwww Request Access Methods</TITLE>
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. 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.14 ! frystyk 68: If a method is safe, it doesn't produce any side effects on the server
2.7 frystyk 69: <PRE>
70: #define HTMethod_isSafe(me) ((me) & (METHOD_GET|METHOD_HEAD))
71: </PRE>
2.11 frystyk 72: <H3>
2.14 ! frystyk 73: Does the Method Replace or Add to Metainformation
! 74: </H3>
! 75: <P>
! 76: Most methods override the current set of metainformation stored in an
! 77: <A HREF="HTAnchor.html">anchor</A>. However, a few methods actually only
! 78: add to the anchor metainformation. We have a small macro to make the distinction.
! 79: <PRE>
! 80: #define HTMethod_addMeta(me) ((me) & (METHOD_TRACE | METHOD_OPTIONS))
! 81: </PRE>
! 82: <H3>
2.12 frystyk 83: Does a Method include Entity?
2.11 frystyk 84: </H3>
85: <P>
2.7 frystyk 86: Does a method include an entity to be sent from the client to the server?
87: <PRE>
88: #define HTMethod_hasEntity(me) ((me) & (METHOD_PUT | METHOD_POST))
2.1 frystyk 89: </PRE>
90: <PRE>
91: #endif /* HTMETHOD_H */
92: </PRE>
2.11 frystyk 93: <P>
94: <HR>
2.10 frystyk 95: <ADDRESS>
2.14 ! frystyk 96: @(#) $Id: HTMethod.html,v 2.13 1996/07/02 22:54:52 frystyk Exp $
2.10 frystyk 97: </ADDRESS>
2.11 frystyk 98: </BODY></HTML>
Webmaster