TreeFrogFramework: src/thttpresponse.h Source File

Go to the documentation of this file.

1#pragma once

2#include <QByteArray>

3#include <QDateTime>

4#include <TGlobal>

5#include <THttpResponseHeader>

6

7class QIODevice;

8

9

11public:

15

18 bool isBodyNull() const;

19 void setBody(const QByteArray &body);

20 QByteArray body() const;

21 void setBodyFile(const QString &filePath);

23 int64_t bodyLength() const { return (bodyDevice) ? bodyDevice->size() : 0; }

24 void clear();

25

26private:

28 QByteArray tmpByteArray;

29 QIODevice *bodyDevice {nullptr};

30

33};

34

The THttpResponse class contains response information for HTTP.

Definition thttpresponse.h:10

const THttpResponseHeader & header() const

Return the HTTP header.

Definition thttpresponse.h:17

THttpResponse()

Constructor.

Definition thttpresponse.h:12

QIODevice * bodyIODevice()

Returns the IO device of the body currently set.

Definition thttpresponse.h:22

THttpResponseHeader & header()

Return the HTTP header.

Definition thttpresponse.h:16

int64_t bodyLength() const

Returns the number of bytes of the body.

Definition thttpresponse.h:23

#define T_CORE_EXPORT

Definition tdeclexport.h:28

#define T_DISABLE_COPY(Class)

Definition tdeclexport.h:37

#define T_DISABLE_MOVE(Class)

Definition tdeclexport.h:41