Function fromRequest

Summary

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

(1) template <typename T>
    T fromRequest(const HttpRequest &req)

(2) template <>
    std::shared_ptr< Json::Value > fromRequest(const HttpRequest &req)

Function overload

Synopsis

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

template <typename T>
T fromRequest(const HttpRequest &req)

Description

This template is used to convert a request object to a custom type object. Users must specialize the template for a particular type.

Mentioned in

Source

Lines 39-45 in lib/inc/drogon/HttpRequest.h.

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

Synopsis

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

template <>
std::shared_ptr< Json::Value > fromRequest(const HttpRequest &req)

Description

No description yet.

Mentioned in

Source

Lines 398-402 in lib/inc/drogon/HttpRequest.h. Line 71 in lib/inc/drogon/HttpRequest.h.

template <>
inline std::shared_ptr<Json::Value> fromRequest(const HttpRequest &req)
{
    return req.getJsonObject();
}





Add Discussion as Guest

Log in to DocsForge