Function fromResponse

Summary

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

(1) template <typename T>
    T fromResponse(const HttpResponse &resp)

(2) template <>
    std::shared_ptr< Json::Value > fromResponse(const HttpResponse &resp)

Function overload

Synopsis

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

template <typename T>
T fromResponse(const HttpResponse &resp)

Description

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

Source

Lines 35-42 in lib/inc/drogon/HttpResponse.h.

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

Synopsis

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

template <>
std::shared_ptr< Json::Value > fromResponse(const HttpResponse &resp)

Description

No description yet.

Source

Lines 390-394 in lib/inc/drogon/HttpResponse.h.

template <>
inline std::shared_ptr<Json::Value> fromResponse(const HttpResponse &resp)
{
    return resp.getJsonObject();
}





Add Discussion as Guest

Log in to DocsForge