1/*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef Reponse_DEFINED
9#define Reponse_DEFINED
10
11struct MHD_Connection;
12struct Request;
13class SkData;
14
15namespace Response {
16    // SendOK just sends an empty response with a 200 OK status code.
17    int SendOK(MHD_Connection* connection);
18
19    int SendError(MHD_Connection* connection, const char* msg);
20
21    int SendData(MHD_Connection* connection, const SkData* data, const char* type,
22                 bool setContentDisposition = false, const char* dispositionString = nullptr);
23
24    int SendJSON(MHD_Connection* connection, Request* request, int n);
25
26    int SendTemplate(MHD_Connection* connection, bool redirect = false,
27                     const char* redirectUrl = nullptr);
28}
29
30#endif
31