Files
MaxScale/server/core/maxscale/httpresponse.hh
Markus Mäkelä ebc9e4bd3b MXS-1220: Clean up resource, request and response headers
Cleaned up various parts of the resource, request and response class
headers.

Moved `using` declarations into .cc files.

Made the Resource class non-copyable as it isn't really meant to be
copied.
2017-05-04 09:14:03 +03:00

59 lines
1.3 KiB
C++

#pragma once
/*
* Copyright (c) 2016 MariaDB Corporation Ab
*
* Use of this software is governed by the Business Source License included
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
*
* Change Date: 2019-07-01
*
* On the date above, in accordance with the Business Source License, use
* of this software will be governed by version 2 or later of the General
* Public License.
*/
#include <maxscale/cppdefs.hh>
#include <map>
#include <string>
#include <tr1/memory>
#include <microhttpd.h>
#include <maxscale/jansson.hh>
#include "http.hh"
class HttpResponse
{
public:
/**
* @brief Create new HTTP response
*
* @param response Response body
* @param code HTTP return code
*/
HttpResponse(int code = MHD_HTTP_OK, json_t* response = NULL);
HttpResponse(const HttpResponse& response);
HttpResponse& operator = (const HttpResponse& response);
~HttpResponse();
/**
* @brief Get the response body
*
* @return The response body
*/
json_t* get_response() const;
/**
* @brief Get the HTTP response code
*
* @return The HTTP response code
*/
int get_code() const;
private:
json_t* m_body; /**< Message body */
int m_code; /**< The HTTP code for the response */
};