SourcePro C++ 13.0 |
SourcePro® C++ API Reference Guide |
Product Documentation: SourcePro C++ Documentation Home |
Encapsulates an entire HTTP request including the request line, header list, and request body. More...
#include <rw/http/RWHttpRequest.h>
Public Member Functions | |
RWHttpRequest () | |
RWHttpRequest (const RWCString &method, const RWCString &path, const RWHttpHeaderList &headers=RWHttpHeaderList(), const RWHttpRequestBody &body=RWHttpRequestStringBody()) | |
RWHttpRequest (const RWHttpRequest &request) | |
RWHttpRequestBody & | getBody (void) const |
RWHttpHeaderList | getHeaders () const |
int | getMajorVersion (void) const |
RWCString | getMethod (void) const |
int | getMinorVersion (void) const |
RWCString | getPath () const |
bool | isValid () const |
RWHttpRequest & | operator= (const RWHttpRequest &request) |
RWCString | requestLine (void) const |
void | setBody (const RWHttpRequestBody &body) |
void | setHeaders (const RWHttpHeaderList &headerList) |
void | setMethod (const RWCString &method) |
void | setPath (const RWCString &path) |
void | setVersion (int majorVersion, int minorVersion) |
Class RWHttpRequest defines the HTTP request methods in the HTTP specifications. For HTTP/1.1, the commands GET
, POST
, HEAD
, PUT
, DELETE
, TRACE
, and OPTIONS
are supported. Class RWHttpRequest enables you to construct a full request and add header information to a request.
RWHttpRequest::RWHttpRequest | ( | ) |
Constructs a default RWHttpRequest.
RWHttpRequest::RWHttpRequest | ( | const RWCString & | method, |
const RWCString & | path, | ||
const RWHttpHeaderList & | headers = RWHttpHeaderList() , |
||
const RWHttpRequestBody & | body = RWHttpRequestStringBody() |
||
) |
Accepts the method, path, headers, and body for the request. Both a method and path are required, but a header list and body are optional. The RWCString should contain 7-bit US-ASCII data.
RWHttpRequest::RWHttpRequest | ( | const RWHttpRequest & | request | ) |
Copy constructor.
|
inline |
Returns a reference to the internal body object. This method can be used to retrieve the body associated with the request object.
|
inline |
Returns the list of headers associated with self.
|
inline |
Returns the major portion of the HTTP version. The default value is 1
.
|
inline |
Returns the request type, such as GET
. The RWCString should contain 7-bit US-ASCII data.
|
inline |
Returns the minor portion of the HTTP version. The default value is 1
.
|
inline |
Returns the path associated with the RWHttpRequest. The RWCString should contain 7-bit US-ASCII data.
|
inline |
Returns true
if this is a valid RWHttpRequest object. Otherwise returns false
. To be valid, the object must have a method verb and URI associated with it, and the body of the object must be valid.
RWHttpRequest& RWHttpRequest::operator= | ( | const RWHttpRequest & | request | ) |
Assignment operator.
RWCString RWHttpRequest::requestLine | ( | void | ) | const |
Returns a string representing the Request-Line
for this request. It is similar to GET
/
HTTP/1.1
. The RWCString should contain 7-bit US-ASCII data.
|
inline |
Sets the internal body of the request to body.
|
inline |
Sets the internal list of headers to headerList.
|
inline |
Sets the request type, such as GET
. The RWCString should contain 7-bit US-ASCII data.
|
inline |
Sets the target path of the RWHttpRequest to path. The RWCString should contain 7-bit US-ASCII data.
|
inline |
Sets the internal HTTP version that is used in the request. The default version is 1.1.
Copyright © 2014 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.