12 #ifndef ROOT_THttpCallArg 13 #define ROOT_THttpCallArg 19 #include <condition_variable> 68 void SetMethod(
const char *method) { fMethod = method; }
71 void SetTopName(
const char *topname) { fTopName = topname; }
169 void AddHeader(
const char *name,
const char *value);
const char * GetFileName() const
returns file name from request URL
void SetZipping(Int_t kind)
Set kind of content zipping 0 - none 1 - only when supported in request header 2 - if supported and c...
void SetRequestHeader(const char *h)
set full set of request header
Bool_t IsMethod(const char *name) const
returns kTRUE if post method is used
UInt_t fWSId
! websocket identifier, used in web-socket related operations
Bool_t IsPostMethod() const
returns kTRUE if post method is used
void SetPathName(const char *p)
set request path name
UInt_t GetWSId() const
get web-socket id
void SetWSHandle(TNamed *handle)
assign websocket handle with HTTP call
Int_t NumHeader() const
returns number of fields in header
TString fQuery
! additional arguments
const char * GetPathName() const
returns path name from request URL
void SetQuery(const char *q)
set request query
void * fBinData
! binary data, assigned with http call
void * GetPostData() const
return pointer on posted with request data
const char * GetQuery() const
returns request query (string after ? in request URL)
void SetContentType(const char *typ)
set content type like "text/xml" or "application/json"
void SetPostponed()
mark reply as postponed - submitting thread will not be inform
void SetUserName(const char *n)
set name of authenticated user
TString CountHeader(const TString &buf, Int_t number=-1111) const
method used to counter number of headers or returns name of specified header
void SetContent(const char *c)
Set content directly.
void SetPostData(void *data, Long_t length, Bool_t make_copy=kFALSE)
set data, posted with the request buffer should be allocated with malloc(length+1) call...
void SetTopName(const char *topname)
set engine-specific top-name
#define ClassDef(name, id)
void SetEncoding(const char *typ)
Set Content-Encoding header like gzip.
The TNamed class is the base class for all named ROOT classes.
void SetPathAndFileName(const char *fullpath)
set complete path of requested http element For instance, it could be "/folder/subfolder/get.bin" Here "/folder/subfolder/" is element path and "get.bin" requested file.
TString fContentType
! type of content
TString fPathName
! item path
void Set404()
mark reply as 404 error - page/request not exists or refused
TNamed * fWSHandle
! web-socket handle, derived from TNamed class
Int_t NumRequestHeader() const
returns number of fields in request header
const char * GetUserName() const
return authenticated user name (0 - when no authentication)
virtual void HttpReplied()
virtual method to inform object that http request is processed Normally condition is notified and wai...
TString fRequestHeader
! complete header, provided with request
Long_t fPostDataLength
! length of binary data
Long_t fBinDataLength
! length of binary data
TString fTopName
! top item name
void SetBinData(void *data, Long_t length)
set binary data, which will be returned as reply body
void SetJson()
set content type as JSON
Bool_t fNotifyFlag
! indicate that notification called
void SetExtraHeader(const char *name, const char *value)
add extra http header value to the reply
TString AccessHeader(TString &buf, const char *name, const char *value=0, Bool_t doing_set=kFALSE)
method used to get or set http header in the string buffer Header has following format: field1 : valu...
const char * GetTopName() const
returns engine-specific top-name
void * fPostData
! binary data received with post request
void SetFileName(const char *f)
set request file name
Bool_t IsPostponed() const
const void * GetContent() const
TString fUserName
! authenticated user name (if any)
std::condition_variable fCond
! condition used to wait for processing
Int_t fZipping
! indicate if content should be zipped
void SetWSId(UInt_t id)
set web-socket id
void SetMethod(const char *method)
set request method kind like GET or POST
void SetXml()
set content type as XML
TString fHeader
! response header like ContentEncoding, Cache-Control and so on
const char * GetContentType() const
THttpCallArg()
constructor
void NotifyCondition()
method used to notify condition which waiting when operation will complete Condition notified only if...
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
TNamed * TakeWSHandle()
takeout websocket handle with HTTP call can be done only once
TString GetPostDataAsString() const
returns post data as TString
Mother of all ROOT objects.
TString fContent
! text content (if any)
void AddHeader(const char *name, const char *value)
Set name: value pair to reply header Content-Type field handled separately - one should use SetConten...
TString fMethod
! request method like GET or POST
void SetFile(const char *filename=0)
indicate that http request should response with file content
Bool_t IsContentType(const char *typ) const
Int_t Atoi() const
Return integer value of string.
TString GetRequestHeaderName(Int_t number) const
returns field name in request header
Int_t GetZipping() const
return kind of content zipping
TString GetRequestHeader(const char *name)
get named field from request header
Long_t GetPostDataLength() const
return length of posted with request data
~THttpCallArg()
destructor
TString fFileName
! file name
const char * GetMethod() const
returns request method like GET or POST
Bool_t CompressWithGzip()
compress reply data with gzip compression
TString GetHeader(const char *name)
return specified header
void FillHttpHeader(TString &buf, const char *header=0)
fill HTTP header
TString GetHeaderName(Int_t number) const
returns field name in header
const char * Data() const
Long_t GetContentLength() const