HttpRequestMethod Class Reference

#include <RequestMethod.h>

Inheritance diagram for HttpRequestMethod:
Collaboration diagram for HttpRequestMethod:

Public Member Functions

 HttpRequestMethod ()
 
 HttpRequestMethod (Http::MethodType const aMethod)
 
 HttpRequestMethod (const SBuf &)
 
void HttpRequestMethodXXX (char const *)
 
HttpRequestMethodoperator= (const HttpRequestMethod &aMethod)
 
HttpRequestMethodoperator= (Http::MethodType const aMethod)
 
bool operator== (Http::MethodType const &aMethod) const
 
bool operator== (HttpRequestMethod const &aMethod) const
 
bool operator!= (Http::MethodType const &aMethod) const
 
bool operator!= (HttpRequestMethod const &aMethod) const
 
HttpRequestMethodoperator++ ()
 
Http::MethodType id () const
 
const SBufimage () const
 
bool isHttpSafe () const
 
bool isIdempotent () const
 
bool respMaybeCacheable () const
 
bool shouldInvalidate () const
 
bool purgesOthers () const
 

Private Attributes

Http::MethodType theMethod
 Method type. More...
 
SBuf theImage
 Used for storing the Http::METHOD_OTHER only. A copy of the parsed method text. More...
 

Detailed Description

This class represents an HTTP Request METHOD

  • i.e. PUT, POST, GET etc. It has a runtime extension facility to allow it to efficiently support new methods

Definition at line 26 of file RequestMethod.h.

Constructor & Destructor Documentation

HttpRequestMethod::HttpRequestMethod ( )
inline

Definition at line 29 of file RequestMethod.h.

HttpRequestMethod::HttpRequestMethod ( Http::MethodType const  aMethod)
inline

Definition at line 30 of file RequestMethod.h.

HttpRequestMethod::HttpRequestMethod ( const SBuf s)
explicit

Construct a HttpRequestMethod from an SBuf string such as "GET" or from a range of chars such as "FOO" from buffer "GETFOOBARBAZ"

Assumes the s parameter contains only the characters representing the method name

Definition at line 73 of file RequestMethod.cc.

References SBuf::caseCmp(), SBuf::cmp(), Config, image(), SBuf::isEmpty(), Http::METHOD_ENUM_END, Http::METHOD_OTHER, SquidConfig::onoff, SquidConfig::relaxed_header_parser, theImage, and theMethod.

Member Function Documentation

void HttpRequestMethod::HttpRequestMethodXXX ( char const *  begin)
Http::MethodType HttpRequestMethod::id ( ) const
inline

Get an ID representation of the method.

Return values
Http::METHOD_NONEthe method is unset
Http::METHOD_OTHERthe method is not recognized and has no unique ID
*the method is on of the recognized HTTP methods.

Definition at line 73 of file RequestMethod.h.

References theMethod.

Referenced by HttpReply::bodySize(), clientIsContentLengthValid(), Transients::copyToShm(), HttpRequest::effectiveRequestUri(), ClientHttpRequest::handleAdaptedHeader(), CacheManager::ParseHeaders(), storeKeyPublic(), storeKeyPublicByRequestMethod(), and urlMakeAbsolute().

bool HttpRequestMethod::isHttpSafe ( ) const

Whether this method is defined as a "safe" in HTTP/1.1 see RFC 2616 section 9.1.1

Definition at line 114 of file RequestMethod.cc.

References Http::METHOD_GET, Http::METHOD_HEAD, Http::METHOD_OPTIONS, Http::METHOD_PRI, Http::METHOD_PROPFIND, Http::METHOD_REPORT, Http::METHOD_SEARCH, and theMethod.

Referenced by FwdState::checkRetriable().

bool HttpRequestMethod::isIdempotent ( ) const
bool HttpRequestMethod::operator!= ( Http::MethodType const &  aMethod) const
inline

Definition at line 53 of file RequestMethod.h.

References theMethod.

bool HttpRequestMethod::operator!= ( HttpRequestMethod const &  aMethod) const
inline

Definition at line 54 of file RequestMethod.h.

References operator==().

HttpRequestMethod& HttpRequestMethod::operator++ ( )
inline

Iterate through all HTTP method IDs.

Definition at line 59 of file RequestMethod.h.

References assert, Http::METHOD_ENUM_END, and theMethod.

HttpRequestMethod& HttpRequestMethod::operator= ( const HttpRequestMethod aMethod)
inline

Definition at line 35 of file RequestMethod.h.

References theImage, and theMethod.

HttpRequestMethod& HttpRequestMethod::operator= ( Http::MethodType const  aMethod)
inline

Definition at line 41 of file RequestMethod.h.

References SBuf::clear(), theImage, and theMethod.

bool HttpRequestMethod::operator== ( Http::MethodType const &  aMethod) const
inline

Definition at line 47 of file RequestMethod.h.

References theMethod.

Referenced by operator!=().

bool HttpRequestMethod::operator== ( HttpRequestMethod const &  aMethod) const
inline

Definition at line 48 of file RequestMethod.h.

References Http::METHOD_OTHER, theImage, and theMethod.

bool HttpRequestMethod::respMaybeCacheable ( ) const
bool HttpRequestMethod::shouldInvalidate ( ) const

Whether this method SHOULD (or MUST) invalidate existing cached entries. Invalidation is always determined by the response

RFC 2616 defines invalidate as either immediate purge or delayed explicit revalidate all stored copies on next use.

Return values
trueSHOULD invalidate. Response details can raise this to a MUST.
falseOther details will determine. Method is not a factor.

Definition at line 263 of file RequestMethod.cc.

References Http::METHOD_DELETE, Http::METHOD_OTHER, Http::METHOD_POST, Http::METHOD_PURGE, Http::METHOD_PUT, and theMethod.

Referenced by purgesOthers().

Member Data Documentation

SBuf HttpRequestMethod::theImage
private

The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors