41 #ifndef _networkhttprequest_cpp
42 #define _networkhttprequest_cpp
44 #include "Network/httprequest.h"
46 #include "stringtool.h"
60 RequestMethod(Method),
124 if( Method.size() >= 3 ) {
156 if( Method.size() >= 5 ) {
181 for( HeaderFieldContainer::const_iterator FieldIt = this->
MessageFields.begin() ; FieldIt != this->
MessageFields.end() ; ++FieldIt )
183 RequestStream << (*FieldIt).HeaderName <<
": " << (*FieldIt).HeaderValue <<
"\r\n";
185 RequestStream <<
"\r\n";
188 return RequestStream.str();
194 return this->
Decompose(CurrIt,Message.end());
199 if( CurrIt != EndIt ) {
209 if( !Length.empty() ) {
235 { this->
SetField(
"Expect",Expect); }
238 {
return this->
GetField(
"Expect"); }
253 { this->
SetField(
"User-Agent",UserAgent); }
256 {
return this->
GetField(
"User-Agent"); }
HTTPRequest()
Blank constructor.
String::const_iterator StringIterator
Convenience typedef for String iterators.
Retrieves a list of the supported HTTP methods on the server.
Boole ParseHTTPFields(StringIterator &CurrIt, const StringIterator EndIt)
Parses the HTTP fields from a provided string.
void SetURI(const URI &URI)
Sets the URI of the resource being requested.
bool Boole
Generally acts a single bit, true or false.
String ConvertToString() const
Combines the set components of this URI into a usable String for transmission.
~HTTPRequest()
Class destructor.
Moves a resource from one URI to another.
const String & GetFromHeader() const
Gets the From Header.
Requests the server accept enclosed data as a new subordinate of the specified resource/URI. Such as a blog or forum post.
void SetMethod(const Network::HTTPRequestMethod Method)
Sets the method to be used for the request.
const String & GetExpectHeader() const
Gets the Expect Header.
void SetFromHeader(const String &From)
Sets the From Header.
const URI & GetURI() const
Gets the URI of the resource being requested.
HTTPRequestMethod RequestMethod
The HTTP method to use for the request.
UInt16 Major
The Major component of the version to be expressed.
Requests a representation of the specified resource.
const String & GetField(const String &FieldName) const
Gets a Name-Value pair for a header field in the message.
std::stringstream StringStream
A Datatype used for streaming operations with strings.
SimpleVersion MessageVersion
The version component for this response.
Unlocks a resource, freeing it for other purposes.
UInt16 Minor
The Minor component of the version to be expressed.
static String ConvertRequestMethod(const Network::HTTPRequestMethod Method)
Converts a HTTPRequestMethod enum value to it's text representation.
Copies a resource from one URI to another.
Places or replaces a supplied resource at the specified URI.
Retrieves a property, stored as XML, from a resource. Can alternatively be overloaded to retrieve the...
Boole GetMessageComponent(StringIterator &CurrIt, const StringIterator EndIt, String &Component)
Extracts all characters from CurrIt until the first space encountered or EndIt, whichever comes first...
void SetExpectHeader(const String &Expect)
Sets the Expect Header.
Similar to GET, but only requests the header without the body.
void SetHostHeader(const String &Host)
Sets the Host Header.
const String & GetContentLengthHeader() const
Gets the Content-Length Header.
URI & ParseFromString(const String &ToParse)
Parses the contents of a String into this URI.
const String & GetHostHeader() const
Gets the Host Header.
void SetField(const String &FieldName, const String &FieldValue)
Sets a Name-Value pair for a header field in the message.
Requests a list of changes or additions done by other sessions.
Deletes the specified resource.
Applies partial modifications to a resource.
void SetUserAgentHeader(const String &UserAgent)
Sets the User-Agent Header.
Boole Decompose(const String &Message)
Populates the members of this class with data from a text HTTP Message.
Boole ParseHTTPHeader(StringIterator &CurrIt, const StringIterator EndIt)
Parses the information contained in the Message Header.
URI RequestURI
The URI of the resource to request.
A helper class for the reading and using of Uniform Resource Identifiers.
Boole ParseHTTPVersion(const String &ToParse)
Parses the HTTP version from a provided string.
The bulk of the engine components go in this namspace.
HeaderFieldContainer MessageFields
A container of fields to populate the message header with.
String MessageBody
The body of the message.
const String & GetUserAgentHeader() const
Gets the User-Agent Header.
Converts the request connection to a tunnel, useful for sending traffic through a proxy...
Can change and/or delete multiple properties of a resource in a single atomic act.
HTTPRequestMethod
This enum is a listing of commonly supported HTTP request methods.
Can be used to create a new directory. "COL" is short for Collection, which is the term commonly used...
Locks a resource to prevent alterations being made to it by another session. This is similar in funct...
std::string String
A datatype used to a series of characters.
Network::HTTPRequestMethod GetMethod() const
Gets the method to be used for the request.
Use for error conditions, not an actual request method.
String Compose() const
Creates a completed Message that can be sent across an HTTP connection.