1 #ifndef CGI___NCBICGIR__HPP
2 #define CGI___NCBICGIR__HPP
63 void SetRawCgi(
bool is_raw);
64 bool IsRawCgi(
void)
const;
69 void SetStatus(
unsigned int code,
const string& reason =
kEmptyStr);
72 void SetHeaderValue (
const string& name,
const string&
value);
73 void SetHeaderValue (
const string& name,
const struct tm&
value);
74 void SetHeaderValue (
const string& name,
const CTime&
value);
75 void RemoveHeaderValue(
const string& name);
78 string GetHeaderValue (
const string& name)
const;
79 bool HaveHeaderValue(
const string& name)
const;
82 void SetContentType(
const string&
type);
85 string GetContentType(
void)
const;
91 void SetFilename(
const string& name,
size_t size = 0);
105 void SetMultipartMode(EMultipartMode
mode = eMultipart_mixed);
106 EMultipartMode GetMultipartMode(
void);
108 void BeginPart (
const string& name,
const string&
type,
size_t size = 0);
110 void EndLastPart(
void);
136 int GetOutputFD(
void)
const;
142 void Flush(
void)
const;
147 bool IsHeaderWritten()
const;
156 void RequireWriteHeader(
bool require);
158 void SetTrackingCookie(
const string& name,
const string&
value,
159 const string& domain,
const string& path,
167 void SetThrowOnBadOutput(
bool throw_on_bad_output);
176 void SetExceptionAfterHEAD(
bool expt_after_head);
179 bool AcceptRangesBytes(
void)
const;
182 bool HaveContentRange(
void)
const;
195 void InitCORSHeaders(
const string&
origin,
196 const string& jquery_callback =
kEmptyStr);
206 void Finalize(
void)
const;
215 bool GetChunkedTransferEnabled(
void)
const;
216 void SetChunkedTransferEnabled(
bool value);
218 static size_t GetChunkSize(
void);
222 void FinishChunkedTransfer(
void);
224 void AbortChunkedTransfer(
void);
231 bool CanSendTrailer(
void)
const;
236 void AddTrailer(
const string& name);
238 void RemoveTrailer(
const string& name);
240 bool HaveTrailer(
const string& name)
const;
242 string GetTrailerValue(
const string& name)
const;
245 void SetTrailerValue(
const string& name,
const string&
value);
288 void x_RestoreOutputExceptions(
void);
289 bool x_ValidateHeader(
const string& name,
const string&
value)
const;
CRetryContext – Retry context.
std::ofstream out("events_result.xml")
main entry point for tests
static const char * sm_HTTPStatusName
const CCgiRequest * m_Request
unique_ptr< bool > m_TrailerEnabled
void SetRequestMethod(CCgiRequest::ERequestMethod method)
Set HTTP request method.
static const char * sm_ContentRange
void SetMultipartMode(EMultipartMode mode=eMultipart_mixed)
string GetContentType(void) const
Get content type.
map< string, string, PNocase > TMap
static const char * sm_CacheControl
void SetHeaderValue(const string &name, const string &value)
unique_ptr< CCgiCookie > m_TrackingCookie
void x_SetSession(const CCgiSession &session)
static const char * sm_AcceptRanges
CCgiRequest::ERequestMethod m_RequestMethod
void SetLocation(const CUrl &url, const IUrlEncoder *encoder=0)
Set the "Location:" HTTP header.
NCBI_PARAM_DECL(bool, CGI, ExceptionAfterHEAD)
static const char * sm_ContentTypeMixed
static const char * sm_ContentTypeDefault
void SetRawCgi(bool is_raw)
bool m_RequireWriteHeader
static const char * sm_FilenamePrefix
static const char * sm_ContentTypeName
CNcbiOstream::iostate m_OutputExpt
CNcbiOstream & out(void) const
Get output stream. Throw exception if GetOutput() is NULL.
static const char * sm_ContentTypeRelated
static const char * sm_ContentDispoName
typedef NCBI_PARAM_TYPE(CGI, ExceptionAfterHEAD) TCGI_ExceptionAfterHEAD
EMultipartMode m_IsMultipart
void SetCgiRequest(const CCgiRequest &request)
void RequireWriteHeader(bool require)
Define if WriteHeader() must be called or can be skipped.
bool m_DisableTrackingCookie
NCBI_PARAM_DECL(bool, CGI, ThrowOnBadOutput)
static const char * sm_HTTPStatusDefault
const CCgiCookies & Cookies(void) const
static const char * sm_LocationName
CCgiResponse(const CCgiResponse &)
bool IsHeaderWritten() const
void SetContentType(const string &type)
Set content type (text/html by default if not provided)
string GetHeaderValue(const string &name) const
typedef NCBI_PARAM_TYPE(CGI, ThrowOnBadOutput) TCGI_ThrowOnBadOutput
CNcbiOstream & WriteHeader(void) const
Write HTTP response header to the output stream.
bool IsRawCgi(void) const
ERequestMethod
Standard request methods.
static const char * sm_AcceptRangesBytes
const CCgiSession * m_Session
static const char * sm_ContentTypeXMR
TCGI_ThrowOnBadOutput m_ThrowOnBadOutput
static const char * sm_BoundaryPrefix
int GetOutputFD(void) const
Get file descriptor of the output stream (-1 if not applicable)
void BeginPart(const string &name, const string &type, size_t size=0)
EMultipartMode GetMultipartMode(void)
TCGI_ExceptionAfterHEAD m_ExceptionAfterHEAD
string GetStringUID(TUID uid=0) const
Return string representation of UID.
CDiagContext & GetDiagContext(void)
Get diag context instance.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
string ComposeUrl(CUrlArgs::EAmpEncoding amp_enc, const IUrlEncoder *encoder=0) const
Compose the URL.
@ eAmp_Char
Use & to separate arguments.
const struct ncbi::grid::netcache::search::fields::SIZE size
Defines: CTimeFormat - storage class for time format.
static const GLdouble origin[]