12#ifndef ROOT_THttpCallArg
13#define ROOT_THttpCallArg
19#include <condition_variable>
110 virtual const char *
GetWSKind()
const {
return "websocket"; }
214 void ReplaceAllinContent(
const std::string &from,
const std::string &to,
bool once =
false);
246 template <
class T,
typename... Args>
249 fWSEngine = std::make_shared<T>(args...);
#define ClassDefOverride(name, id)
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char mode
Contains arguments for single HTTP call.
std::string fPostData
! data received with post request - text - or binary
Bool_t fNotifyFlag
! indicate that notification called
Bool_t CompressWithGzip()
Compress reply data with gzip compression.
void Set404()
mark reply as 404 error - page/request not exists or refused
void SetRequestHeader(const char *h)
set full set of request header
void SetJson()
Set content type as "application/json".
UInt_t GetWSId() const
get web-socket id
void SetFileName(const char *f)
set request file name
TString GetHeader(const char *name)
Return specified header.
void SetFile(const char *filename=nullptr)
indicate that http request should response with file content
std::condition_variable fCond
! condition used to wait for processing
virtual Bool_t CanPostpone() const
Return true if reply can be postponed by server
TString fTopName
! top item name
TString GetRequestHeader(const char *name)
get named field from request header
void SetPostData(void *data, Long_t length, Bool_t make_copy=kFALSE)
Set data, posted with the request.
const char * GetUserName() const
return authenticated user name (0 - when no authentication)
std::shared_ptr< THttpWSEngine > TakeWSEngine()
Takeout websocket handle with HTTP call.
void AddHeader(const char *name, const char *value)
Set name: value pair to reply header.
void SetText()
Set content type as "text/plain".
void SetTextContent(std::string &&txt)
Set content type as "text/plain" and also assigns content.
TString GetHeaderName(Int_t number) const
returns field name in header
virtual void HttpReplied()
virtual method to inform object that http request is processed
TString fUserName
! authenticated user name (if any)
void SetUserName(const char *n)
set name of authenticated user
void SetPathName(const char *p)
set request path name
const char * GetTopName() const
returns engine-specific top-name
void ReplaceAllinContent(const std::string &from, const std::string &to, bool once=false)
Replace all occurrences of string in content.
Bool_t IsPostMethod() const
returns kTRUE if post method is used
const void * GetPostData() const
return pointer on posted with request data
virtual const char * GetWSKind() const
provide WS kind - websocket, longpoll, rawlongpoll
void SetTopName(const char *topname)
set engine-specific top-name
const char * GetQuery() const
returns request query (string after ? in request URL)
TString fPathName
! item path
std::shared_ptr< THttpWSEngine > fWSEngine
! web-socket engine, which supplied to run created web socket
void NotifyCondition()
Method used to notify condition which waiting when operation will complete.
void CreateWSEngine(Args... args)
Int_t NumRequestHeader() const
returns number of fields in request header
void SetPathAndFileName(const char *fullpath)
Set complete path of requested http element.
TString fContentType
! type of content
Long_t GetContentLength() const
TString fQuery
! additional arguments
void SetMethod(const char *method)
set request method kind like GET or POST
virtual ~THttpCallArg()
destructor
TString CountHeader(const TString &buf, Int_t number=-1111) const
method used to counter number of headers or returns name of specified header
const void * GetContent() const
void SetPostponed()
mark as postponed - reply will not be send to client immediately
void SetBinary()
Set content type as "application/x-binary".
void AddNoCacheHeader()
Set CacheControl http header to disable browser caching.
TString AccessHeader(TString &buf, const char *name, const char *value=nullptr, Bool_t doing_set=kFALSE)
method used to get or set http header in the string buffer
Bool_t IsContentType(const char *typ) const
void SetXml()
Set content type as "text/xml".
void SetExtraHeader(const char *name, const char *value)
add extra http header value to the reply
Int_t fZipping
! indicate if and when content should be compressed
void SetContent(const char *cont)
Set content as text.
Bool_t IsPostponed() const
void SetWSId(UInt_t id)
set web-socket id
TString fFileName
! file name
UInt_t fWSId
! websocket identifier, used in web-socket related operations
void SetQuery(const char *q)
set request query
TString GetRequestHeaderName(Int_t number) const
returns field name in request header
Int_t NumHeader() const
returns number of fields in header
std::string fContent
! content - text or binary
void SetBinaryContent(std::string &&bin)
Set content type as "application/x-binary" and also assigns content.
void SetContentType(const char *typ)
set content type like "text/xml" or "application/json"
virtual const char * GetWSPlatform() const
provide WS platform - http, fastcgi, cef3, qt5
const char * GetPathName() const
returns path name from request URL
TString fMethod
! request method like GET or POST
void SetEncoding(const char *typ)
Set Content-Encoding header like gzip.
Long_t GetPostDataLength() const
return length of posted with request data
void SetJsonContent(std::string &&json)
Set content type as "application/json" and also assigns content.
const char * GetMethod() const
returns request method like GET or POST
Bool_t IsMethod(const char *name) const
returns kTRUE if post method is used
const char * GetContentType() const
const char * GetFileName() const
returns file name from request URL
void AssignWSId()
Assign websocket identifier from the engine.
void SetZipping(Int_t mode=kZipLarge)
void SetXmlContent(std::string &&xml)
Set content type as "text/xml" and also assigns content.
std::string FillHttpHeader(const char *header=nullptr)
Fills HTTP header, which can be send at the beginning of reply on the http request.
TString fRequestHeader
! complete header, provided with request
TString fHeader
! response header like ContentEncoding, Cache-Control and so on
Online http server for arbitrary ROOT application.
Internal instance used to exchange WS functionality between THttpServer and THttpWSHandler.
Class for user-side handling of websocket with THttpServer.
Mother of all ROOT objects.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
Int_t Atoi() const
Return integer value of string.
const char * Data() const