openthread-br  0.3.0-72c0388
Public Member Functions | List of all members
otbr::rest::Request Class Reference

#include <src/rest/request.hpp>

Public Member Functions

 Request (void)
 
void SetUrl (const char *aString, size_t aLength)
 
void SetBody (const char *aString, size_t aLength)
 
void SetContentLength (size_t aContentLength)
 
void SetMethod (int32_t aMethod)
 
void SetReadComplete (void)
 
void ResetReadComplete (void)
 
HttpMethod GetMethod () const
 
std::string GetBody () const
 
std::string GetUrl (void) const
 
bool IsComplete (void) const
 

Detailed Description

This class implements an instance to host services used by border router.

Constructor & Destructor Documentation

◆ Request()

otbr::rest::Request::Request ( void  )

The constructor is to initialize Request instance.

Member Function Documentation

◆ GetBody()

std::string otbr::rest::Request::GetBody ( ) const

This method returns the HTTP method of this request.

Returns
A HttpMethod enum representing HTTP method of this request.

◆ GetMethod()

HttpMethod otbr::rest::Request::GetMethod ( ) const

This method returns the HTTP method of this request.

Returns
A integer representing HTTP method.

◆ GetUrl()

std::string otbr::rest::Request::GetUrl ( void  ) const

This method returns the url for this request.

Returns
A string contains the url of this request.

◆ IsComplete()

bool otbr::rest::Request::IsComplete ( void  ) const

This method indicates whether this request is parsed completely.

◆ ResetReadComplete()

void otbr::rest::Request::ResetReadComplete ( void  )

This method resets the request then it could be set by parser from start.

◆ SetBody()

void otbr::rest::Request::SetBody ( const char *  aString,
size_t  aLength 
)

This method sets the body field of a request.

Parameters
[in]aStringA pointer points to body string.
[in]aLengthLength of the body string

◆ SetContentLength()

void otbr::rest::Request::SetContentLength ( size_t  aContentLength)

This method sets the content-length field of a request.

Parameters
[in]aContentLengthAn unsigned integer representing content-length.

◆ SetMethod()

void otbr::rest::Request::SetMethod ( int32_t  aMethod)

This method sets the method of the parsed request.

Parameters
[in]aMethodAn integer representing request method.

◆ SetReadComplete()

void otbr::rest::Request::SetReadComplete ( void  )

This method labels the request as complete which means it no longer need to be parsed one more time .

◆ SetUrl()

void otbr::rest::Request::SetUrl ( const char *  aString,
size_t  aLength 
)

This method sets the Url field of a request.

Parameters
[in]aStringA pointer points to url string.
[in]aLengthLength of the url string

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