HttpRequestMethod Class Reference

#include <RequestMethod.h>

Collaboration diagram for HttpRequestMethod:

Public Member Functions

 HttpRequestMethod ()
 
 HttpRequestMethod (Http::MethodType const aMethod)
 
 HttpRequestMethod (const SBuf &)
 
void HttpRequestMethodXXX (char const *)
 
HttpRequestMethodoperator= (Http::MethodType const aMethod)
 
 operator bool () const
 whether the method is set/known More...
 
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() [1/3]

HttpRequestMethod::HttpRequestMethod ( )
inline

Definition at line 29 of file RequestMethod.h.

◆ HttpRequestMethod() [2/3]

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

Definition at line 30 of file RequestMethod.h.

◆ HttpRequestMethod() [3/3]

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 Config, image(), SBuf::isEmpty(), Http::METHOD_ENUM_END, Http::METHOD_OTHER, SquidConfig::onoff, SquidConfig::relaxed_header_parser, theImage, and theMethod.

Member Function Documentation

◆ HttpRequestMethodXXX()

void HttpRequestMethod::HttpRequestMethodXXX ( char const *  begin)

◆ id()

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 70 of file RequestMethod.h.

References theMethod.

Referenced by HttpReply::bodySize(), HttpRequest::checkEntityFraming(), HttpRequest::effectiveRequestUri(), ClientHttpRequest::handleAdaptedHeader(), CacheManager::ParseHeaders(), purgeEntriesByHeader(), storeKeyPublic(), and storeKeyPublicByRequestMethod().

◆ image()

◆ isHttpSafe()

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().

◆ isIdempotent()

bool HttpRequestMethod::isIdempotent ( ) const

◆ operator bool()

HttpRequestMethod::operator bool ( ) const
inlineexplicit

Definition at line 42 of file RequestMethod.h.

References Http::METHOD_NONE, and theMethod.

◆ operator!=() [1/2]

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

Definition at line 50 of file RequestMethod.h.

References theMethod.

◆ operator!=() [2/2]

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

Definition at line 51 of file RequestMethod.h.

References operator==().

◆ operator++()

HttpRequestMethod & HttpRequestMethod::operator++ ( )
inline

Iterate through all HTTP method IDs.

Definition at line 56 of file RequestMethod.h.

References assert, Http::METHOD_ENUM_END, and theMethod.

◆ operator=()

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

Definition at line 35 of file RequestMethod.h.

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

◆ operator==() [1/2]

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

Definition at line 44 of file RequestMethod.h.

References theMethod.

Referenced by operator!=().

◆ operator==() [2/2]

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

Definition at line 45 of file RequestMethod.h.

References Http::METHOD_OTHER, theImage, and theMethod.

◆ purgesOthers()

◆ respMaybeCacheable()

bool HttpRequestMethod::respMaybeCacheable ( ) const

◆ shouldInvalidate()

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

◆ theImage

SBuf HttpRequestMethod::theImage
private

◆ theMethod


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors