SNAP Library 3.0, User Reference  2016-07-20 17:56:49
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
THttp Class Reference

#include <http.h>

Static Public Member Functions

static bool IsHtmlFExt (const TStr &FExt)
 
static bool IsGifFExt (const TStr &FExt)
 
static TStr GetReasonPhrase (const int &StatusCd)
 

Static Public Attributes

static const TStr HttpStr ="http"
 
static const TStr SlashStr ="/"
 
static const TStr ColonStr =":"
 
static const TStr ContTypeFldNm ="Content-Type"
 
static const TStr ContLenFldNm ="Content-Length"
 
static const TStr HostFldNm ="Host"
 
static const TStr AcceptRangesFldNm ="Accept-Ranges"
 
static const TStr CacheCtrlFldNm ="Cache-Control"
 
static const TStr AcceptFldNm ="Accept"
 
static const TStr SrvFldNm ="Server"
 
static const TStr ConnFldNm ="Connection"
 
static const TStr FetchIdFldNm ="FetchId"
 
static const TStr LocFldNm ="Location"
 
static const TStr SetCookieFldNm ="Set-Cookie"
 
static const TStr CookieFldNm ="Cookie"
 
static const TStr TextFldVal ="text/"
 
static const TStr TextPlainFldVal ="text/plain"
 
static const TStr TextHtmlFldVal ="text/html"
 
static const TStr TextXmlFldVal ="text/xml"
 
static const TStr TextWmlFldVal ="text/vnd.wap.wml"
 
static const TStr TextJavaScriptFldVal ="text/javascript"
 
static const TStr TextCssFldVal ="text/css"
 
static const TStr ImageIcoFldVal ="image/x-icon"
 
static const TStr ImagePngFldVal ="image/png"
 
static const TStr ImageGifFldVal ="image/gif"
 
static const TStr ImageJpgFldVal ="image/jpg"
 
static const TStr AppOctetFldVal ="application/octet-stream"
 
static const TStr AppSoapXmlFldVal ="application/soap+xml"
 
static const TStr AppW3FormFldVal ="application/x-www-form-urlencoded"
 
static const TStr AppJSonFldVal = "application/json"
 
static const TStr ConnKeepAliveFldVal ="keep-alive"
 
static const int DfPortN =80
 
static const int OkStatusCd =200
 
static const int RedirStatusCd =300
 
static const int BadRqStatusCd =400
 
static const int ErrStatusCd =400
 
static const int ErrNotFoundStatusCd =404
 
static const int InternalErrStatusCd =500
 
static const TStr GetMethodNm ="GET"
 
static const TStr HeadMethodNm ="HEAD"
 
static const TStr PostMethodNm ="POST"
 
static const TStr UndefMethodNm ="UndefinedMethod"
 

Detailed Description

Definition at line 5 of file http.h.

Member Function Documentation

TStr THttp::GetReasonPhrase ( const int &  StatusCd)
static

Definition at line 62 of file http.cpp.

62  {
63  switch (StatusCd){
64  case 200: return "OK";
65  case 201: return "Created";
66  case 202: return "Accepted";
67  case 204: return "No Content";
68  case 300: return "Multiple Choices";
69  case 301: return "Moved Permanently";
70  case 302: return "Moved Temporarily";
71  case 304: return "Not Modified";
72  case 400: return "Bad Request";
73  case 401: return "Unauthorized";
74  case 403: return "Forbidden";
75  case 404: return "Not Found";
76  case 500: return "Internal Server Error";
77  case 501: return "Not Implemented";
78  case 502: return "Bad Gateway";
79  case 503: return "Service Unavailable";
80  default: return TStr("Unknown Status Code ")+TInt::GetStr(StatusCd);
81  }
82 }
TStr GetStr() const
Definition: dt.h:1107
Definition: dt.h:412
bool THttp::IsGifFExt ( const TStr FExt)
static

Definition at line 47 of file http.cpp.

47  {
48  return (FExt.GetUc()==TFile::GifFExt.GetUc());
49 }
static const TStr GifFExt
Definition: fl.h:592
TStr GetUc() const
Definition: dt.h:493
bool THttp::IsHtmlFExt ( const TStr FExt)
static

Definition at line 42 of file http.cpp.

42  {
43  TStr UcFExt=FExt.GetUc();
44  return ((UcFExt==TFile::HtmlFExt.GetUc())||(UcFExt==TFile::HtmFExt.GetUc()));
45 }
TStr GetUc() const
Definition: dt.h:493
static const TStr HtmlFExt
Definition: fl.h:590
static const TStr HtmFExt
Definition: fl.h:591
Definition: dt.h:412

Member Data Documentation

const TStr THttp::AcceptFldNm ="Accept"
static

Definition at line 17 of file http.h.

const TStr THttp::AcceptRangesFldNm ="Accept-Ranges"
static

Definition at line 15 of file http.h.

const TStr THttp::AppJSonFldVal = "application/json"
static

Definition at line 39 of file http.h.

const TStr THttp::AppOctetFldVal ="application/octet-stream"
static

Definition at line 36 of file http.h.

const TStr THttp::AppSoapXmlFldVal ="application/soap+xml"
static

Definition at line 37 of file http.h.

const TStr THttp::AppW3FormFldVal ="application/x-www-form-urlencoded"
static

Definition at line 38 of file http.h.

const int THttp::BadRqStatusCd =400
static

Definition at line 50 of file http.h.

const TStr THttp::CacheCtrlFldNm ="Cache-Control"
static

Definition at line 16 of file http.h.

const TStr THttp::ColonStr =":"
static

Definition at line 10 of file http.h.

const TStr THttp::ConnFldNm ="Connection"
static

Definition at line 19 of file http.h.

const TStr THttp::ConnKeepAliveFldVal ="keep-alive"
static

Definition at line 40 of file http.h.

const TStr THttp::ContLenFldNm ="Content-Length"
static

Definition at line 13 of file http.h.

const TStr THttp::ContTypeFldNm ="Content-Type"
static

Definition at line 12 of file http.h.

const TStr THttp::CookieFldNm ="Cookie"
static

Definition at line 23 of file http.h.

const int THttp::DfPortN =80
static

Definition at line 46 of file http.h.

const int THttp::ErrNotFoundStatusCd =404
static

Definition at line 52 of file http.h.

const int THttp::ErrStatusCd =400
static

Definition at line 51 of file http.h.

const TStr THttp::FetchIdFldNm ="FetchId"
static

Definition at line 20 of file http.h.

const TStr THttp::GetMethodNm ="GET"
static

Definition at line 56 of file http.h.

const TStr THttp::HeadMethodNm ="HEAD"
static

Definition at line 57 of file http.h.

const TStr THttp::HostFldNm ="Host"
static

Definition at line 14 of file http.h.

const TStr THttp::HttpStr ="http"
static

Definition at line 8 of file http.h.

const TStr THttp::ImageGifFldVal ="image/gif"
static

Definition at line 34 of file http.h.

const TStr THttp::ImageIcoFldVal ="image/x-icon"
static

Definition at line 32 of file http.h.

const TStr THttp::ImageJpgFldVal ="image/jpg"
static

Definition at line 35 of file http.h.

const TStr THttp::ImagePngFldVal ="image/png"
static

Definition at line 33 of file http.h.

const int THttp::InternalErrStatusCd =500
static

Definition at line 53 of file http.h.

const TStr THttp::LocFldNm ="Location"
static

Definition at line 21 of file http.h.

const int THttp::OkStatusCd =200
static

Definition at line 48 of file http.h.

const TStr THttp::PostMethodNm ="POST"
static

Definition at line 58 of file http.h.

const int THttp::RedirStatusCd =300
static

Definition at line 49 of file http.h.

const TStr THttp::SetCookieFldNm ="Set-Cookie"
static

Definition at line 22 of file http.h.

const TStr THttp::SlashStr ="/"
static

Definition at line 9 of file http.h.

const TStr THttp::SrvFldNm ="Server"
static

Definition at line 18 of file http.h.

const TStr THttp::TextCssFldVal ="text/css"
static

Definition at line 31 of file http.h.

const TStr THttp::TextFldVal ="text/"
static

Definition at line 25 of file http.h.

const TStr THttp::TextHtmlFldVal ="text/html"
static

Definition at line 27 of file http.h.

const TStr THttp::TextJavaScriptFldVal ="text/javascript"
static

Definition at line 30 of file http.h.

const TStr THttp::TextPlainFldVal ="text/plain"
static

Definition at line 26 of file http.h.

const TStr THttp::TextWmlFldVal ="text/vnd.wap.wml"
static

Definition at line 29 of file http.h.

const TStr THttp::TextXmlFldVal ="text/xml"
static

Definition at line 28 of file http.h.

const TStr THttp::UndefMethodNm ="UndefinedMethod"
static

Definition at line 59 of file http.h.


The documentation for this class was generated from the following files: