Function toRequest

Summary

#include <lib/inc/drogon/HttpRequest.h>

(1) template <typename T>
    HttpRequestPtr toRequest(T &&)

(2) template <>
    HttpRequestPtr toRequest(Json::Value &&pJson)

Function overload

Synopsis

#include <lib/inc/drogon/HttpRequest.h>

template <typename T>
HttpRequestPtr toRequest(T &&)

Description

This template is used to create a request object from a custom type object by calling the newCustomHttpRequest(). Users must specialize the template for a particular type.

Source

Lines 52-58 in lib/inc/drogon/HttpRequest.h.

template <typename T>
HttpRequestPtr toRequest(T &&)
{
    LOG_ERROR << "You must specialize the toRequest template for the type of "
              << DrClassMap::demangle(typeid(T).name());
    exit(1);
}

Synopsis

#include <lib/inc/drogon/HttpRequest.h>

template <>
HttpRequestPtr toRequest(Json::Value &&pJson)

Description

No description yet.

Source

Lines 407-411 in lib/inc/drogon/HttpRequest.h. Line 63 in lib/inc/drogon/HttpRequest.h.

template <>
inline HttpRequestPtr toRequest(Json::Value &&pJson)
{
    return HttpRequest::newHttpJsonRequest(std::move(pJson));
}





Add Discussion as Guest

Log in to DocsForge