MythTV  master
Classes | Macros | Typedefs | Enumerations | Variables
mythhttptypes.h File Reference
#include <array>
#include <deque>
#include <chrono>
#include <QMap>
#include <QFile>
#include <QString>
#include <QDateTime>
#include <QStringList>
#include <QHostAddress>
#include <QSslConfiguration>
#include "libmythbase/http/mythhttpcommon.h"
#include "libmythbase/http/mythmimetype.h"
Include dependency graph for mythhttptypes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MythHTTPConfig
 
class  MythHTTPContent
 
class  MythHTTP
 

Macros

#define HTTP_SOCKET_TIMEOUT_MS   10000
 
#define HTTP_SERVICES_DIR   QString("/services/")
 
#define HTTP_DEFAULT_ALLOWED   (HTTPHead | HTTPGet | HTTPOptions | HTTPPost)
 

Typedefs

using HTTPMap = QMultiMap< QString, QString >
 
using HTTPQueries = HTTPMap
 
using HTTPHeaders = std::shared_ptr< HTTPMap >
 
using HTTPData = std::shared_ptr< MythHTTPData >
 
using HTTPContents = std::vector< HTTPData >
 
using HTTPRequest2 = std::shared_ptr< MythHTTPRequest >
 
using HTTPResponse = std::shared_ptr< MythHTTPResponse >
 
using HTTPFile = std::shared_ptr< MythHTTPFile >
 
using HTTPVariant = std::variant< std::monostate, HTTPData, HTTPFile >
 
using HTTPQueue = std::deque< HTTPVariant >
 
using HTTPRange = std::pair< uint64_t, uint64_t >
 
using HTTPRanges = std::vector< HTTPRange >
 
using HTTPFunction = std::function< HTTPResponse(HTTPRequest2)>
 
using HTTPHandler = std::pair< QString, HTTPFunction >
 
using HTTPHandlers = std::vector< HTTPHandler >
 
using HTTPMulti = std::pair< HTTPData, HTTPData >
 
using HTTPRegisterTypes = std::function< void()>
 
using HTTPServicePtr = std::shared_ptr< MythHTTPService >
 
using HTTPServicePtrs = std::vector< HTTPServicePtr >
 
using HTTPServiceCtor = std::function< HTTPServicePtr()>
 
using HTTPService = std::pair< QString, HTTPServiceCtor >
 
using HTTPServices = std::vector< HTTPService >
 

Enumerations

enum  MythHTTPVersion { HTTPUnknownVersion = 0, HTTPZeroDotNine, HTTPOneDotZero, HTTPOneDotOne }
 
enum  MythHTTPRequestType {
  HTTPUnknown = 0x0000, HTTPHead = 0x0001, HTTPGet = 0x0002, HTTPPost = 0x0004,
  HTTPPut = 0x0008, HTTPDelete = 0x0010, HTTPOptions = 0x0020
}
 
enum  MythHTTPStatus {
  HTTPSwitchingProtocols = 101, HTTPOK = 200, HTTPAccepted = 202, HTTPPartialContent = 206,
  HTTPMovedPermanently = 301, HTTPNotModified = 304, HTTPBadRequest = 400, HTTPUnauthorized = 401,
  HTTPForbidden = 403, HTTPNotFound = 404, HTTPMethodNotAllowed = 405, HTTPRequestTimeout = 408,
  HTTPRequestedRangeNotSatisfiable = 416, HTTPTooManyRequests = 429, HTTPInternalServerError = 500, HTTPNotImplemented = 501,
  HTTPBadGateway = 502, HTTPServiceUnavailable = 503, HTTPNetworkAuthenticationRequired = 511
}
 
enum  MythHTTPConnection { HTTPConnectionClose = 0, HTTPConnectionKeepAlive, HTTPConnectionUpgrade }
 
enum  MythHTTPEncode { HTTPNoEncode = 0, HTTPGzip, HTTPChunked }
 
enum  MythHTTPCacheType {
  HTTPIgnoreCache = 0x0000, HTTPNoCache = 0x0001, HTTPETag = 0x0002, HTTPLastModified = 0x0004,
  HTTPShortLife = 0x0100, HTTPMediumLife = 0x0200, HTTPLongLife = 0x0400
}
 

Variables

static QString s_multipartBoundary = "mYtHtVxXxXxX"
 
static QString s_defaultHTTPPage
 

Macro Definition Documentation

◆ HTTP_SOCKET_TIMEOUT_MS

#define HTTP_SOCKET_TIMEOUT_MS   10000

Definition at line 24 of file mythhttptypes.h.

◆ HTTP_SERVICES_DIR

#define HTTP_SERVICES_DIR   QString("/services/")

Definition at line 25 of file mythhttptypes.h.

◆ HTTP_DEFAULT_ALLOWED

#define HTTP_DEFAULT_ALLOWED   (HTTPHead | HTTPGet | HTTPOptions | HTTPPost)

Definition at line 102 of file mythhttptypes.h.

Typedef Documentation

◆ HTTPMap

using HTTPMap = QMultiMap<QString,QString>

Definition at line 33 of file mythhttptypes.h.

◆ HTTPQueries

Definition at line 34 of file mythhttptypes.h.

◆ HTTPHeaders

using HTTPHeaders = std::shared_ptr<HTTPMap>

Definition at line 35 of file mythhttptypes.h.

◆ HTTPData

using HTTPData = std::shared_ptr<MythHTTPData>

Definition at line 36 of file mythhttptypes.h.

◆ HTTPContents

using HTTPContents = std::vector<HTTPData>

Definition at line 37 of file mythhttptypes.h.

◆ HTTPRequest2

using HTTPRequest2 = std::shared_ptr<MythHTTPRequest>

Definition at line 38 of file mythhttptypes.h.

◆ HTTPResponse

using HTTPResponse = std::shared_ptr<MythHTTPResponse>

Definition at line 39 of file mythhttptypes.h.

◆ HTTPFile

using HTTPFile = std::shared_ptr<MythHTTPFile>

Definition at line 40 of file mythhttptypes.h.

◆ HTTPVariant

using HTTPVariant = std::variant<std::monostate, HTTPData, HTTPFile>

Definition at line 41 of file mythhttptypes.h.

◆ HTTPQueue

using HTTPQueue = std::deque<HTTPVariant>

Definition at line 42 of file mythhttptypes.h.

◆ HTTPRange

using HTTPRange = std::pair<uint64_t,uint64_t>

Definition at line 43 of file mythhttptypes.h.

◆ HTTPRanges

using HTTPRanges = std::vector<HTTPRange>

Definition at line 44 of file mythhttptypes.h.

◆ HTTPFunction

using HTTPFunction = std::function<HTTPResponse(HTTPRequest2)>

Definition at line 45 of file mythhttptypes.h.

◆ HTTPHandler

using HTTPHandler = std::pair<QString,HTTPFunction>

Definition at line 46 of file mythhttptypes.h.

◆ HTTPHandlers

using HTTPHandlers = std::vector<HTTPHandler>

Definition at line 47 of file mythhttptypes.h.

◆ HTTPMulti

using HTTPMulti = std::pair<HTTPData,HTTPData>

Definition at line 48 of file mythhttptypes.h.

◆ HTTPRegisterTypes

using HTTPRegisterTypes = std::function<void()>

Definition at line 49 of file mythhttptypes.h.

◆ HTTPServicePtr

using HTTPServicePtr = std::shared_ptr<MythHTTPService>

Definition at line 50 of file mythhttptypes.h.

◆ HTTPServicePtrs

using HTTPServicePtrs = std::vector<HTTPServicePtr>

Definition at line 51 of file mythhttptypes.h.

◆ HTTPServiceCtor

using HTTPServiceCtor = std::function<HTTPServicePtr()>

Definition at line 52 of file mythhttptypes.h.

◆ HTTPService

using HTTPService = std::pair<QString,HTTPServiceCtor>

Definition at line 53 of file mythhttptypes.h.

◆ HTTPServices

using HTTPServices = std::vector<HTTPService>

Definition at line 54 of file mythhttptypes.h.

Enumeration Type Documentation

◆ MythHTTPVersion

Enumerator
HTTPUnknownVersion 
HTTPZeroDotNine 
HTTPOneDotZero 
HTTPOneDotOne 

Definition at line 81 of file mythhttptypes.h.

◆ MythHTTPRequestType

Enumerator
HTTPUnknown 
HTTPHead 
HTTPGet 
HTTPPost 
HTTPPut 
HTTPDelete 
HTTPOptions 

Definition at line 89 of file mythhttptypes.h.

◆ MythHTTPStatus

Enumerator
HTTPSwitchingProtocols 
HTTPOK 
HTTPAccepted 
HTTPPartialContent 
HTTPMovedPermanently 
HTTPNotModified 
HTTPBadRequest 
HTTPUnauthorized 
HTTPForbidden 
HTTPNotFound 
HTTPMethodNotAllowed 
HTTPRequestTimeout 
HTTPRequestedRangeNotSatisfiable 
HTTPTooManyRequests 
HTTPInternalServerError 
HTTPNotImplemented 
HTTPBadGateway 
HTTPServiceUnavailable 
HTTPNetworkAuthenticationRequired 

Definition at line 104 of file mythhttptypes.h.

◆ MythHTTPConnection

Enumerator
HTTPConnectionClose 
HTTPConnectionKeepAlive 
HTTPConnectionUpgrade 

Definition at line 127 of file mythhttptypes.h.

◆ MythHTTPEncode

Enumerator
HTTPNoEncode 
HTTPGzip 
HTTPChunked 

Definition at line 134 of file mythhttptypes.h.

◆ MythHTTPCacheType

Enumerator
HTTPIgnoreCache 
HTTPNoCache 
HTTPETag 
HTTPLastModified 
HTTPShortLife 
HTTPMediumLife 
HTTPLongLife 

Definition at line 141 of file mythhttptypes.h.

Variable Documentation

◆ s_multipartBoundary

QString s_multipartBoundary = "mYtHtVxXxXxX"
static

◆ s_defaultHTTPPage

QString s_defaultHTTPPage
static
Initial value:
=
"<!DOCTYPE html>"
"<HTML>"
"<HEAD>"
"<TITLE>%1</TITLE>"
"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=ISO-8859-1\">"
"</HEAD>"
"<BODY><H1>%1</H1></BODY>"
"</HTML>"

Definition at line 153 of file mythhttptypes.h.

Referenced by MythHTTPResponse::ErrorResponse(), and MythHTTPRoot::RedirectRoot().