File:  [Public] / libwww / Library / src / HTMethod.html
Revision 2.16: download - view: text, annotated - select for diffs
Thu May 14 02:10:45 1998 UTC (26 years ago) by frystyk
Branches: MAIN
CVS tags: before_webdav, Release-5-3-1, Release-5-2-8, Release-5-2-6, Release-5-2, Release-5-1m, HEAD, Before-New-Trace-Messages, Amaya_2_4, Amaya-6-3, Amaya-6-1, Amaya-5-2, Amaya-4-3-2, Amaya-4-3-1, Amaya-4-3, Amaya-4-1-2, Amaya-4-1-0, Amaya-4-0-0, Amaya-3-2-1, Amaya-3-2
Changing old pub/WWW links

<HTML>
<HEAD>
  <!-- Changed by: Henrik Frystyk Nielsen,  1-Jul-1996 -->
  <TITLE>W3C Sample Code Library libwww Request Access Methods</TITLE>
</HEAD>
<BODY>
<H1>
  Request Access Methods
</H1>
<PRE>
/*
**	(c) COPYRIGHT MIT 1995.
**	Please first read the full copyright statement in the file COPYRIGH.
*/
</PRE>
<P>
This module keeps a list of valid methods to be performed on a
<A HREF="HTReq.html">request object</A>, for example <B>GET</B>, <B>HEAD</B>,
<B>PUT</B>, <B>POST</B>, <B>DELETE</B>, etc.&nbsp;You can assign which method
to be performed on the request object <A HREF="HTReq.html">directly</A> or
you can go through the <A HREF="HTReq.html">Access module</A> for higher
level functions.
<P>
This module is implemented by <A HREF="HTMethod.c">HTMethod.c</A>, and it
is a part of the <A HREF="http://www.w3.org/Library/"> W3C Sample Code
Library</A>.
<PRE>#ifndef HTMETHOD_H
#define HTMETHOD_H

</PRE>
<P>
<B>NOTE:</B> The anchor list of allowed methods is a bitflag, not at list!
<PRE>
typedef enum {
    METHOD_INVALID	= 0x0,
    METHOD_GET		= 0x1,
    METHOD_HEAD		= 0x2,    
    METHOD_POST		= 0x4,    
    METHOD_PUT		= 0x8,
    METHOD_PATCH	= 0x10,
    METHOD_DELETE	= 0x20,
    METHOD_TRACE	= 0x40,
    METHOD_OPTIONS	= 0x80,
    METHOD_LINK		= 0x100,
    METHOD_UNLINK	= 0x200
} HTMethod;
</PRE>
<H3>
  Get Method Enumeration
</H3>
<P>
Gives the enumeration value of the method as a function of the (char *) name.
<PRE>
extern HTMethod HTMethod_enum (const char * name);
</PRE>
<H3>
  Get Method String
</H3>
<P>
The reverse of <I>HTMethod_enum()</I>
<PRE>
extern const char * HTMethod_name (HTMethod method);
</PRE>
<H3>
  Is Method "Safe"?
</H3>
<P>
If a method is safe, it doesn't produce any side effects on the server
<PRE>
#define HTMethod_isSafe(me)	((me) &amp; (METHOD_GET|METHOD_HEAD))
</PRE>
<H3>
  Does the Method Replace or Add to Metainformation
</H3>
<P>
Most methods override the current set of metainformation stored in an
<A HREF="HTAnchor.html">anchor</A>. However, a few methods actually only
add to the anchor metainformation. We have a small macro to make the distinction.
<PRE>
#define HTMethod_addMeta(me)  ((me) &amp; (METHOD_TRACE | METHOD_OPTIONS))
</PRE>
<H3>
  Does a Method include Entity?
</H3>
<P>
Does a method include an entity to be sent from the client to the server?
<PRE>
#define HTMethod_hasEntity(me)	((me) &amp; (METHOD_PUT | METHOD_POST))
</PRE>
<PRE>
#endif /* HTMETHOD_H */
</PRE>
<P>
  <HR>
<ADDRESS>
  @(#) $Id: HTMethod.html,v 2.16 1998/05/14 02:10:45 frystyk Exp $
</ADDRESS>
</BODY></HTML>

Webmaster